Question
Programming Project 1:MUST BE DONE IN C++ You learned that computers follow instructions faithfully and they never get tired of repeating the same thing over
Programming Project 1:MUST BE DONE IN C++
You learned that computers follow instructions faithfully and they never get tired of repeating the same thing over and over. You plan to write a simple program Calculator.cpp to see for yourself.
After bragging a bit, the program asks the user to enter 2 numbers. After receiving and storing those it asks the user to enter one of the operations +, -, *, or /. The program then performs that operation on the two numbers and displays the output to the user (if the user enters an operation different from the four operations above, the program notifies the user that it does not know that operation). It then brags some more and asks the user if they want to play again. If the user enters Y or y, the game starts over. Otherwise the program prints Bye bye and terminates.
A few sample runs of the program are shown below:
----------------------------- Run 1 ---------------------------------
Hi, I am really good at math! Put me to the test. Please enter two numbers and then press Enter: 3 6 Please enter one of the operations +, -, * or / and press Enter: + 3 + 6 = 9 I'm great at addition! Play again [Y/N]?: N Bye bye!
----------------------------- Run 2 ---------------------------------
Hi, I am really good at math! Put me to the test. Please enter two numbers and then press Enter: 2.7 0.82 Please enter one of the operations +, -, * or / and press Enter: - 2.7 - 0.82 = 1.88 I'm great at subtraction! Play again [Y/N]?: N Bye bye!
----------------------------- Run 3 ---------------------------------
Hi, I am really good at math! Put me to the test. Please enter two numbers and then press Enter: 1 3 Please enter one of the operations +, -, * or / and press Enter: / 1 / 3 = 0.333333 I'm great at division!
Play again [Y/N]?: Y Hi, I am really good at math! Put me to the test. Please enter two numbers and then press Enter: 3.14 2 Please enter one of the operations +, -, * or / and press Enter: * 3.14 * 2 = 6.28 I'm great at multiplication!
Play again [Y/N]?: y Hi, I am really good at math! Put me to the test. Please enter two numbers and then press Enter: 2 3 Please enter one of the operations +, -, * or / and press Enter: $ I can compute really well, but what you entered is not one of the operations I know ... Play again [Y/N]?: N Bye bye!
Hints: This program is really simple and many of you will find it trivial. The goal of the assignment is for students to get familiar with their development tool, basic program design and the basic structure of a C++ program. You should know almost all of what you need from your C++ course. The program uses 4 variables, two for the numeric values, one for the operation, and one for playing again or terminating. What type should these variables be? To be able to perform a different computation based on the operation entered the program will need to make a choice. Write the program initially without the Play again? functionality. Once you have that, wrap a loop around it to allow for repeated games. Ask for help if you get stuck Deliverables: You should submit a zip file named project1_first_last.zip (where first and last are your first and last name) containing ONLY the files below. Calculator.cpp (copy the file from your project solution in Visual Studio) report.txt (a short text file saying I have tested this program and it has no issues and a sample output from your program (like the examples given above but with your own 2 numbers and operation). If your program has some problem/bug that you are aware of, please mention that in the report.) How you get points: Functionally correct solution 70 points Good program structure 20 points Good variable names, style and comments 10 points How you lose points: You do not submit a report file. Your code does not follow the posted style guidelines. Your code does not contain some appropriate comments. You submit your whole project folder or executable files. Copy and submit only the .cpp file the project asks for.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started