Follow us on Twitter!
It is never to LATE to become what you never WERE.
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 32
Guests Online: 26
Members Online: 6

Registered Members: 82895
Newest Member: kevy90
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Need help with my C++ program please

TROY
Member



Posts: 83
Location: Sheffield, UK
Joined: 17.06.08
Rank:
Moderate
Posted on 20-12-08 23:24
First of all i just want to say im really sorry and i apolagize for these posts that i am doing, they are normally very long and probably confusing of which im really sorry, but i would really appreciate some help. Thanks, anyway.....


i've been working on this "Number detailer", which is what i call it since i have no other name for it (lol Pfft) and im having a few problems with it, it is ment to be a program that instead of making you enter what you want to do with the two numbers, it does everything ( square the numbers, add them, subtract them multiply them, divide them, all at the same time and then gives you the results of all of these things, anyway this is the code:

/* This is a calculator designed, programmed and made by Tr0y, however
this calulator is differnt though, you enter two numbers and then it
give you the sum product subtraction, square root, etc of your two
number, sort of like a number detailer (If they actually even do exist)*/

#include <iostream>
using namespace std;

int main()
{
cout<<"Hello and welcome to the number detailer, designed, programmed and made by Tr0y.\n" "To continue, press Enter to see the menu"<<endl;
cin.get();
loop:
cout<<"Press a number 1 to 3 for one of the options displayed below.\n";
cout<<"1. View information about the author and the program.\n";
cout<<"2. View the programs C++ code.\n";
cout<<"3. To procede to the Number detailer.\n";
cout<<"Please choose an option now: \n";
int choice;
cin>> choice;

if (choice = 1) {
cout<<"This is a calculator designed, programmed and made by Tr0y, however this\n" "calulator is different though, you enter two numbers and then it give you the \n" "sum,product, subtraction, square root, etc of your two number, It basically\n" "gives you all the details of your two numbers, so if you wanted to know what\n" "5 + 5 was AND 5 * 5, then it would give you these results all at the same time, I call it a number detailer. This program was made by me Tr0y, and i personally give anyone permission to reproduce this program, but NOT,i repeat NOT,\n" "distribute it as your own program, especially if you just copy my code and\n" "change my name to yours, please DON'T do this, Thank you.\n";
cout<<"Press return to go back to the menu\n";
cin.get();
goto loop;
}

else if (choice = 2) {
cout<<"\n";
cout<<"Press return to go back to the menu\n";
cin.get();
goto loop;
}
else if (choice = 3) {
system("cls"Wink;
cin.get();
}

}


So BASICALLY (TO SUMERISE) when you get to the menu, it give you three choices and i have put differnt things for these choices, so if the person chooses 1 the get the message for number 1, they enter 2 then they get the message for number 2, and finally when they enter three they get the message for choice three.....However the problem is that no matter what number you put (1-3) it gives you the message for choice number one, im not sure where im going wrong to be honest, it must be a problem with my IF syntaxes or something. Any help would be GREAT! thanks.Grin


Author

RE: Need help with my C++ program please

Futility
Member



Posts: 725
Location: USA
Joined: 17.12.07
Rank:
God
Posted on 20-12-08 23:30
= is the assignment operator.
== is for comparison.


i252.photobucket.com/albums/hh11/zanimabean/Zim.png
Futility91@hotmail.com Futility91
Author

RE: Need help with my C++ program please

TROY
Member



Posts: 83
Location: Sheffield, UK
Joined: 17.06.08
Rank:
Moderate
Posted on 20-12-08 23:43
Futility wrote:
= is the assignment operator.
== is for comparison.


Yep!, works great now, Thanks very very much. Grin


Author

RE: Need help with my C++ program please

hellboundhackersok
Member



Posts: 353
Location:
Joined: 20.09.07
Rank:
Moderate
Warn Level: 95
Posted on 21-12-08 02:39
TROY wrote:
cout<<"Hello and welcome to the number detailer, designed, programmed and made by Tr0y.\n" "To continue, press Enter to see the menu"<<endl;


wait.. shouldn't this be:

Code
cout << "Hello.. blah blah.. made by Tr0y.\n" << "To continue blahblahblah" << endl;


?? Notice the <<


i.imgur.com/qBWHo0R.png
Author

RE: Need help with my C++ program please

bl4ckc4t
Member

Your avatar

Posts: 591
Location: /etc/
Joined: 07.03.06
Rank:
Wiseman
Posted on 21-12-08 03:04
moshbat wrote:
Seriously, read up on your preferred language.:right:


QFT


Author

RE: Need help with my C++ program please

K3174N 420
Member



Posts: 296
Location: In a grow room, growing cannabis.
Joined: 14.09.08
Rank:
Hacker Level 1
Warn Level: 69
Posted on 21-12-08 04:17
moshbat wrote:
bl4ckc4t wrote:
moshbat wrote:
Seriously, read up on your preferred language.:right:


QFT

"Quality fces Time"?


First thing i thought was 'Quit Fucking Talking', Though i could be completly wong and i'ts 'Quite Fucking True'...

Im pretty sure on the middle word... ^^


Anyway, what a dumb post, the differance between = and == is basic. Fundimental. You do need to reread the basics on your languages...


Thanks Yours31f!
img114.imageshack.us/img114/1497/keiran420cy2.jpg
Make poverty history... Cheaper drugs now! - Frank gallagher
[small][center]Einstein climbs to the top of Mt. Sinai to get close enough to talk to God.
Looking up, he asks the Lord...
"God, what does a million years mean to you?"
The Lord replies, "A minute."
"Einstein asks, "And what does a million pounds mean to you?"
The Lord replies, "A penny."
Einste
http://keiran420.ueuo.com/
Author

RE: Need help with my C++ program please

bl4ckc4t
Member

Your avatar

Posts: 591
Location: /etc/
Joined: 07.03.06
Rank:
Wiseman
Posted on 21-12-08 06:12
K3174N 420 wrote:
moshbat wrote:
bl4ckc4t wrote:
moshbat wrote:
Seriously, read up on your preferred language.:right:


QFT

"Quality fces Time"?


First thing i thought was 'Quit Fucking Talking', Though i could be completly wong and i'ts 'Quite Fucking True'...

Im pretty sure on the middle word... ^^


Anyway, what a dumb post, the differance between = and == is basic. Fundimental. You do need to reread the basics on your languages...



Author

RE: Need help with my C++ program please


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 21-12-08 06:31
I liked quit fucking talking better.
Author

RE: Need help with my C++ program please


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 21-12-08 07:02
Also, when posting code it's just kind of etiquette to use the code tags and disable smileys. Finally, when learning the C/++ programming languages, I highly recommend you start with C. There's a lot of OOP stuff that's going to throw you for a loop, and when you decide to go more advanced you're going to be pulling your hair out because you didn't start with C first. here's a good analogy: You can either climb a very tall rock wall or carve a steep but manageable slope. C is very powerful as well.

Edited by on 21-12-08 07:08
Author

RE: Need help with my C++ program please


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 21-12-08 07:53
I believe I'll take that advice and run with it. I have been having trouble making up my mind, whether to start with C or jump straight into C++, and even though I understand the OOP paradigm very well, I still think it would be a good idea to start with C. Plus, after you get the syntax down, there are plenty of languages based on the C syntax, so it would be a lot easier to learn other languages after you got C down. Thanks for helping me make up my mind, I don't know why, but when you put it that way it just kind of clicked with me. lol.
Author

RE: Need help with my C++ program please


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 21-12-08 09:09
Although, on the same note, I found a pretty good tutorial for C and C++, the main one being on C++, thats what the site really focuses on, and they say that with this tutorial, unless you have a specific reason to only learn C, to go ahead into C++, because they start out with all the basic syntax and functions in C (which are the same in C++), and basically teach you C and then tack the OOP and STL on the end for C++. Maybe that would be too much all at once, I don't know, but its basically C until you get to the end of the tutorial, or e-book I should say. Ahh, I digress. I think I'll start on C, but not stay with it very long and go to C++ after I get the basic syntax/functions down, because I get OOP. Blah.
Author

RE: Need help with my C++ program please

spyware
Member



Posts: 4192
Location:
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 21-12-08 15:42
It's not "quite fucking true", QFT stands for "Quoted for truth". Mkay? Mkay.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
[center]�Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?� - Ebert[/ce
Author

RE: Need help with my C++ program please

TROY
Member



Posts: 83
Location: Sheffield, UK
Joined: 17.06.08
Rank:
Moderate
Posted on 21-12-08 16:03
spyware wrote:
It's not "quite fucking true", QFT stands for "Quoted for truth". Mkay? Mkay.


lol


Author

RE: Need help with my C++ program please

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 21-12-08 16:22
Try googleing switch case.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: Need help with my C++ program please

ynori7
Member



Posts: 1486
Location: #valhalla
Joined: 08.10.07
Rank:
God
Posted on 21-12-08 16:45
I dont see why everyone keeps saying to start with C. C++ is much more user friendly for a beginner. Learn the basics with C++ and then move to C.


halls-of-valhalla.org/images/affiliateLogo.png voodoorage.halls-of-valhalla.org/images/smallLogo.png
i537.photobucket.com/albums/ff338/ynori77/archenemysig1.jpg
ynori7 http://halls-of-valhalla.org
Author

RE: Need help with my C++ program please

TROY
Member



Posts: 83
Location: Sheffield, UK
Joined: 17.06.08
Rank:
Moderate
Posted on 21-12-08 16:55
ynori7 wrote:
I dont see why everyone keeps saying to start with C. C++ is much more user friendly for a beginner. Learn the basics with C++ and then move to C.


Yeah im sticking with C++, i like it and btw people cans top posting i completed my program successfully earlier today, my first quite long C++ programGrin lol.


Author

RE: Need help with my C++ program please

bl4ckc4t
Member

Your avatar

Posts: 591
Location: /etc/
Joined: 07.03.06
Rank:
Wiseman
Posted on 21-12-08 18:46
spyware wrote:
It's not "quite fucking true", QFT stands for "Quoted for truth". Mkay? Mkay.


It has a double meaning, 90% of the time it is used in a quote in which the quoted says something that the quotee agreed with. Quoted for Truth can mean the same thing as Quite Fucking True. Mkay? Mkay.


Author

RE: Need help with my C++ program please

spyware
Member



Posts: 4192
Location:
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 21-12-08 18:54
bl4ckc4t wrote:
It has a double meaning, 90% of the time it is used in a quote in which the quoted says something that the quotee agreed with. Quoted for Truth can mean the same thing as Quite Fucking True. Mkay? Mkay.


It doesn't have "more" meanings, (well, it does), but it DOESN'T mean "quite fucking true".

The meaning is "quoted for truth". That, and nothing else. Other meanings are assigned when people forget the real/true meaning of the abbreviation. Of course, in this case "quite fucking true" has the same meaning as "quoted for truth", that doesn't make it the valid meaning though.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
[center]�Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?� - Ebert[/ce
Author

RE: Need help with my C++ program please

bl4ckc4t
Member

Your avatar

Posts: 591
Location: /etc/
Joined: 07.03.06
Rank:
Wiseman
Posted on 21-12-08 19:05
Upon further review, The ruling on the play is overturned. Spyware's ball.




Author

RE: Need help with my C++ program please


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 21-12-08 20:20
TROY wrote:
ynori7 wrote:
I dont see why everyone keeps saying to start with C. C++ is much more user friendly for a beginner. Learn the basics with C++ and then move to C.


Yeah im sticking with C++, i like it and btw people cans top posting i completed my program successfully earlier today, my first quite long C++ programGrin lol.


Anything under 500 lines = short