PSX5Central

Non Gaming Discussions => Off-Topic => Topic started by: QuDDus on February 15, 2004, 11:46:45 AM

Title: C++ help needed
Post by: QuDDus on February 15, 2004, 11:46:45 AM
I am doing a project that will calculate the area and perimeter of square, triangle, and cirlce.

What I am having trouble with is this. I need the program to ask the user if he he/she want to selct circle, square of triangle, and then it should ask them to select area or perimeter.

I am thinking a simple console::write statement(select circle)

or something like that if  you know anything about c++ the help would be very thankful.
Title: C++ help needed
Post by: PS2_-'_'-_PS2 on February 15, 2004, 03:42:57 PM
Find a forum that specialises in programming languages ur gonna get much more to the point responses most likely, thats what i did when i was ding my computing project last yera. Jus post a question and some dude will reply to it. =]
Title: C++ help needed
Post by: shockwaves on February 16, 2004, 12:19:43 AM
Ugh, I know C, and I know java, but I\'m not sure exactly about C++.  

I know in C I would just do a printf asking them to type in the name of the shape, then a scanf that I would prolly have jsut read the first letter, if it\'s just a simple assignment.  If a c, use the circle, etc.  Then the same for area or perimeter.  But I don\'t know if C++ does it the same way.
Title: C++ help needed
Post by: Avatarr on February 16, 2004, 12:39:24 AM
aww, isn\'t this cute ^_^ I\'ve got a program + the source code that\'ll give you just what you need. take a look:

http://www.sheepsheet.com/_programming/crypto/crypto.htm

it\'s not a simple area finder, but it does demonstrate how the command line console can be used for these sorts of things. I just used a switch statement inside a loop to give the user a choice of one of three options. ^_^

check out the crypt.cpp link on the navbar.
Title: C++ help needed
Post by: shockwaves on February 16, 2004, 12:47:37 AM
Ha, nope, not the same as C at all.  Oh well, I tried :)
Title: C++ help needed
Post by: Avatarr on February 16, 2004, 12:50:36 AM
C++ is the object oriented extension of C. the switch statement isn\'t even an object oriented thingamabob. I\'m purdy sure it\'s in C. purdy much everything in C++ is in C, except support for classes.
Title: C++ help needed
Post by: shockwaves on February 16, 2004, 12:55:52 AM
Well, I\'m pretty new to C.  So that\'s prolly why.  I did a similar assignment to the one he\'s talking about in C, so I was just saying how I tackled it.  So odds are you\'re right :)
Title: C++ help needed
Post by: QuDDus on February 16, 2004, 02:26:05 AM
thanks avatarr.

Shockwave I am using visual studio and microsoft has completely change alot of the coding in visual studio we don\'t have to use printf anymore.
Title: C++ help needed
Post by: shockwaves on February 16, 2004, 08:36:15 AM
Oh, well, rock then :)  I\'m glad you got it though.