here is the assignment. What I'm wondering is how to construct the switch statement. I've got the while loop fixed to figure out the calculations, but I'm not sure on how or what the switch statement is supposed to do??
For this assignment, your program should ask the user for three calculations to perform,
one at a time. See the sample output below for a clearer picture. Your program should
print out the results of each of the calculations.
Required structures to use: when handling menu choices, you must use a switch
statement. For dealing with each of the prompts, you must use a loop. You may not use
any predefined libraries/functions to help you with your calculations.
Enter your first number: 28
Enter your second number: 27
1. Find the sum.
2. Find the product.
3. Find the difference.
4. Find the quotient.
5. Find the modulus.
6. Find the smaller number.
7. Find the larger number.
8. Find the first number raised to the second number.
9. Find the second number raised to the first number.
Your choice: 1
1 Replies - 372 Views - Last Post: 20 February 2011 - 05:28 PM
Replies To: Programming Ass. with a loop and a switch statement
Page 1 of 1