lab5_1[1] - F File lab5_1.cpp A Author your name here-P...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* / File: lab5_1.cpp F Author: *** your name here *** A ---------------------------------------------------------- - PROGRAM DISCRIPTION P In this program you will be making a very simple calculator. The calculator will alow a user to add, subtract, multiply, or divide real numbers. r The program will first prompt and read the user for the first number The prompt should look something like this: Please enter the first number: The program will then prompt and read the opperator the user wanted to use. The prompt should look something like this: Choose a opperator: +: for addition -: for subtraction *: for multiplication /: for division Enter your choice: The user will then type the opperator. (I suggest reading it in as a char) ( Then prompt the user for the second number, just as we did the first one. T Use a switch based on the opperator chosen, to perform the calculation and store it in a total variable If the user did not enter a valid opperator, tell them as such, and exit the program. If the user chose division and the second number is 0, display a error message
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/30/2011 for the course PHYSICS 1410 taught by Professor Falco during the Spring '08 term at Texas State.

Page1 / 3

lab5_1[1] - F File lab5_1.cpp A Author your name here-P...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online