PSX5Central
Non Gaming Discussions => Off-Topic => Topic started 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.
-
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. =]
-
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.
-
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.
-
Ha, nope, not the same as C at all. Oh well, I tried :)
-
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.
-
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 :)
-
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.
-
Oh, well, rock then :) I\'m glad you got it though.