Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

Help...Can anyone give me an example program in c++ that computes the area and Perimeter of a triangle using switch statement.

OpenStudy (anonymous):

@kris100 I won't give you the correct code unless you show me that you did take some initiative to solve the problem on your part. Because if I write the code for you, you'll learn nothing. So show how much you have written, then we may discuss the errors, corrections etc.

OpenStudy (rsmith6559):

A switch statement is an n-way branch. Fancy term, but it can be done with a series like: if( variable == x ) {} else if( variable == y ) {} else if( variable == z ) {} else {} Beyond this, you need to ask a more specific question.

OpenStudy (anonymous):

Why would you want to do that?....Am curious. There are much better ways of doing this.

OpenStudy (anonymous):

@jlvm he wants the switch statement to create menus.

OpenStudy (anonymous):

oh.. sorry for the late response guys,. i finished this problem, and hopefully it worked well.lol thanks for your concern replying on my problem..

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!