I Figured It Out *bangs Head On Desk*
DY357LX
Playing since day 1. Still can't Comm.England Join Date: 2002-10-27 Member: 1651Members, Constellation

in Off-Topic
<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.
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
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!
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!
I only have one more java class to go, then I will never need to take programming again!