#17347 - 02/15/03 07:42 AM
First Program (What u think)
|
Joined: Nov 2002
Posts: 1,146
Ice
UGN News Staff
|
UGN News Staff

Joined: Nov 2002
Posts: 1,146
Likes: 1
Canada
|
hehe finally decided to learn some C++ so started reading and came up with this prb lol = ) Its some were from a tutorial but i wrote it from scratched, and made it shorter with out a ELSE, Just have Else if's = ) What u guys think hehe heres the link to the little source = ) http://ice.promodtecnologies.com/cpp.html
Good artists copy, great artists steal.
-Picasso
|
|
|
#17350 - 02/18/03 12:22 AM
Re: First Program (What u think)
|
Joined: Nov 2002
Posts: 1,146
Ice
UGN News Staff
|
UGN News Staff

Joined: Nov 2002
Posts: 1,146
Likes: 1
Canada
|
#include <iostream.h>
int main()
{
int num;
cout<<"Please Guess the Number 1,2,3,4,5,6,7: ";
cin>>num;
if(num==1)
{
cout<<"Sorry Try Again";
}
else if(num==2)
{
cout<<"Sorry Try Again";
}
else if(num==3)
{
cout<<"Sorry Try Again";
}
else if(num==4)
{
cout<<"Sorry Try Again";
}
else if(num==5)
{
cout<<"Ding Ding That is The Correct Number";
}
else if(num==6)
{
cout<<"Sorry Try Again";
}
else if(num==7)
{
cout<<"Sorry Try Again";
}
int a;
cin >> a;
return 0;
} Heres another one lol = ) Little longer but simple stuff Just geting used the Program itself
Good artists copy, great artists steal.
-Picasso
|
|
|
#17351 - 02/18/03 01:24 AM
Re: First Program (What u think)
|
Joined: Mar 2002
Posts: 71
CryptoKnight
Junior Member
|
Junior Member
Joined: Mar 2002
Posts: 71
|
whats the int a at the end for? and thats too many else if statements in my opinion. use a switch case instead. Then again, thats just about style. tut on switch statements
"If you let your wife stand on your toe tonight, she'll stand on your face tomorrow morning" - Sir/Saint Thomas More
-CryptoKnight-
|
|
|
#17352 - 02/18/03 01:27 AM
Re: First Program (What u think)
|
Joined: Mar 2002
Posts: 71
CryptoKnight
Junior Member
|
Junior Member
Joined: Mar 2002
Posts: 71
|
oh, i just read your other program. Thats not how you stop it so you can see it, you are just wasting memory (not like its a lot but hey, its better you dont get used to it now that you are startin to learn). #include "conio.h" getch(); //that will pause till you press a key
"If you let your wife stand on your toe tonight, she'll stand on your face tomorrow morning" - Sir/Saint Thomas More
-CryptoKnight-
|
|
|
#17357 - 03/07/03 04:14 PM
Re: First Program (What u think)
|
Joined: Mar 1983
Posts: 55
Skull
UGN Elder
|
UGN Elder
Joined: Mar 1983
Posts: 55
Iowa
|
Thats because gcc is a c compiler where as g++ is a c++ compiler, i have used both, and they are the same except for that one thing. At any rate, good luck with your programming, its fun, but not usually easy. I've spent the last 2 evens for like 6 hours a day working on my one program so, just be prepared to spend alot of time on it. Don't get discouraged, and ENJOY POINTERS! their your friend...
{Mr. Rage, I plan on showing up to irc tonight, if you could be there, i'd like to have you help me test my program to test requirements if you would please}
Regards,
Skull
Trust me, if i started killing people, there'd None of you left
|
|
|
#17363 - 09/02/03 09:24 AM
Re: First Program (What u think)
|
Joined: Mar 2002
Posts: 27
-=Toxic Wazte=-
Junior Member
|
Junior Member
Joined: Mar 2002
Posts: 27
Va
|
coleman, the program just tells u if you got it right or wrong, thats all...nothing more. even if u didnt know c++ u could go through the code and at least figure that part out
-=Toxic Wazte=-
|
|
|
#17369 - 09/03/03 10:59 PM
Re: First Program (What u think)
|
Joined: Mar 2002
Posts: 599
BackSlash
UGN's Resident Homo
|
UGN's Resident Homo

Joined: Mar 2002
Posts: 599
TN
|
coleman, c++ is a programming language, that means it is used to create other programs. the program ice created has no practical use other than to learn how to program in c++. as for getting c++ go here http://www.borland.com/products/downloads/download_cbuilder.html# click to download the compiler. i believe it is free.
"It's better to burn out, than to fade away."
|
|
|
|
Forums41
Topics33,701
Posts68,795
Average Daily Posts0
|
Members2,174
Most Online1,567 Apr 25th, 2010
|
|
|
Okay WTF?
by HenryMiring on 09/27/17 08:45 AM
|
|
|
|
|
|
|
|