Hello, I could use some help in making a program that computes the volume of either a cube, a cyliner, or box. The user enters the shape (strings) they want (ex: cube. Then the program asks to enter the values such as side length, radius, etc. The program then displays the corresponding shape volume.

Ex: cube with side of 4

The volume of a cube with side=4 is 64.

Recommended Answers

All 3 Replies

Which part is giving you the most trouble? Please post whatever code you have tried sofar...

Also you can use a simple menu driven program where you display all the shapes in a numbered list, ask for a number, and then ask for length, radius etc.
if you go with asking it as string, i suggest you keep multiple names for a shape.
like a box can also be a cuboid or radius can be input as diameter as well.
Vinayak

Yes, please post any code you have already written. We are always ready to assist in any problems you should have,
though we don't usually write any code for users, just help in correcting it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.