I Figured It Out *bangs Head On Desk*

DY357LXDY357LX Playing since day 1. Still can't Comm.England Join Date: 2002-10-27 Member: 1651Members, Constellation
<div class="IPBDescription">Yet Another C++ Nub/Idiot :-)</div> I'm yet another one of those people who wants to learn C++ but
really doesn't have the time. So every now and then i'll open it
up and follow the various tutorials i've bookmarked.
Now i'm not very far into learning this amazingly complicated
language, and I also have a memory like one of those erm.. swimmy things... FISH!
So combine the lack of time with lack of proper memory skills
and you have a struggler.. me :-D

I was set the "task" of writing a program which asks the user to input
2 numbers, adds the numbers together, outputs the number to the screen.

Note to all you wise-*** programmers sitting in your seats, trying to stay on
and not collapse from the laughter...... click "back" now please <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->

So after starring at the screen for 10 minutes, trying to figure out where the
gibberish ends.... it hit me. And here's what my code looks like.....

<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
// Starting to slightly annoy but intrigue me now.

#include <iostream.h>
int numone;
int numtwo;
int numtotal;
int main()
{
// Getting the user to input a number
cout<<"Enter the first number "<<endl;

// Remember that number
cin>>numone;

// Showing the user that you can remember their number
cout<<"You entered the number ";

// Display their number
cout<<numone<<endl;

// Request a second number
cout<<"Please enter a second number "<<endl;
cin>>numtwo;
cout<<"Your second number entered was ";
cout<<numtwo<<endl;
numtotal=numone+numtwo;

// Here comes the tricky bit which i'm tying to figure out...
// adding the inputted numbers together and showing them to the user
// the way their first two numbers were shown to them

cout<<"The total of your two numbers added together is "<<endl;

cout<<numtotal<<endl;

// We're done, press any key
return 0;
}
<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->



It's stupidly easy and rather pointless I know... but it made me shout "YAY!"
when it successfully linked, compiled etc and has given me a much needed boost
for the will to learn more C++.



If you'd like to post how you got started with C++ (or any other complex language),
comment on my code, post idea's sugestions etc etc.
Post links to helpful sites, tutorials, articles etc.
Please do. I like hearing about stuff like this.

Comments

  • OttoDestructOttoDestruct Join Date: 2002-11-08 Member: 7790Members
    Also if you want to learn read my posts that I keep posting since I'm a nublet and don't realize whats going on.
  • MulletMullet Join Date: 2003-04-28 Member: 15910Members, Constellation
    Well I never have really tried C++, but when I was in 7th grade, I got into Visual Basic quite a bit. I don't know what got me interested, but, I just made stupid programs. Some were pretty cool. I made some little progs for the ms gaming zone games (ie. checkers, motocross madness, etc.)

    I havn't used visual basic stuff since 7th grade and If I tried, I probably wouldnt remember anything! I would love to learn C++ but I have NO idea where to start.... Any ideas for newbs to start would help!
  • LegionnairedLegionnaired Join Date: 2002-04-30 Member: 552Members, Constellation
    OMG NUB! USING 3 VARIABLES WHERE j00 COULD UUSE TWO!

    j/k <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->

    It's a good start, when I started learning C++ in my programming class, it took me a day and a half to write something like that. Keep at it!
  • MulletMullet Join Date: 2003-04-28 Member: 15910Members, Constellation
    Sooooooooo.....where can you learn c++? lol....Like free tutorials.
  • DY357LXDY357LX Playing since day 1. Still can&#39;t Comm. England Join Date: 2002-10-27 Member: 1651Members, Constellation
    I've been using <a href='http://www.cprogramming.com/' target='_blank'>cprogramming.com</a> I know the name is alittle mis-leading but it's C++ I assure you.
  • MulletMullet Join Date: 2003-04-28 Member: 15910Members, Constellation
  • BurrBurr Join Date: 2002-11-19 Member: 9358Members
    programing is evil I tell you....EVIL!!!!!

    I only have one more java class to go, then I will never need to take programming again!
Sign In or Register to comment.