I really need help with this project.
1) Write a program that uses a switch program structure
2) Upon user input your switch structure shall calculate and display one of the three loops for loop, while loop, and do-while loop calculations.

Recommended Answers

All 3 Replies

one piece of advice switch statements will only accept built in types of C++. gl.

one piece of advice switch statements will only accept built in types of C++. gl.

Yep - a switch statement will not, for example, accept a string variable for comparison. It will, however, accept a char or int variable type

Another thing that's easy to miss or overlook is to remember to put "break;" at the end of each case, otherwise it'll also continue executing what's in the following cases (unless this is something you specifically want to happen)

For more information on switch statements, or the various loops, i recommend searching on google. There's a lot of information available by searching (for example) "c++ switch statement example" or "c++ for loop example", etc

If you have any more questions after searching some, by all means post up and we'll help you out with it

I really need help with this project.
1) Write a program that uses a switch program structure
2) Upon user input your switch structure shall calculate and display one of the three loops for loop, while loop, and do-while loop calculations.

smells like an assignment?
If so show efforts before ask for help!

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.