Unformatted text preview: Switch..case statements Assignment 21
Write a simple calculator program. Ask the user if s/he wants to add ('+') subtract ('-'), multiply ('*') or divide ('/') and then ask for the number. Perform the operation with the given number. Start the "display" at zero. Stop when the user enters 'X' (for exit). See the screen shot below for a sample run. Use a switch..case statement to handle the user input (+,-,*,/,X). Use the assignment 20 program as a starting point. ...
View Full Document
- Summer '07
- Addition, Elementary arithmetic, simple calculator program