akosiraff

Download simpleOperations C++ Answer

Oct 12th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1.  
  2. Download: https://solutionzip.com/downloads/simpleoperations/
  3. For this program, ask the user for the following:
  4. • Input a number that you will treat as an integer.
  5. • The calculation the user wants to perform that is chosen from one of the following operations:
  6. o + (addition)
  7. o – (subtraction)
  8. o * (multiplication) o / (division)
  9. o %(mod)
  10. • A second number also treated as an integer. Store the calculation choice in a char variable.
  11. Using a switch statement, switch on the char variable to perform the calculation. The switch statement should have a default block that prints out an error message if the user enters anything other than ‘+’, ‘- ‘, ‘*’, ‘%’, or ‘/’.
  12. Save the result in a variable called answer.
  13. Finally, put all of this into the body of a for loop that repeats six times.
  14. You must provide good prompts to the user and check for any error conditions before performing the operations.
  15. Finally, make sure you comment your code. At the top of the .cpp file, you must include at a least the following: name, class and section number, date, and purpose.
  16. Download: https://solutionzip.com/downloads/simpleoperations/
Add Comment
Please, Sign In to add comment