This preview shows page 1. Sign up to view the full content.
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
This note was uploaded on 01/11/2010 for the course CMPSC 101 taught by Professor Drobish,renee during the Summer '07 term at Pennsylvania State University, University Park.
- Summer '07