Write a C++ program called hw.cpp that performs addition and multiplication operations. The user enters an initial number and then continues to add or multiply new user-specified numbers to the...


Write a C++ program called hw.cpp that performs addition and multiplication operations.


The user enters an initial number and then continues to add or multiply new user-specified numbers to the growing sum/product.


At each loop repetition, the user entersx to multiply,+ to add, or q for quit. If s/he chooses add or multiply, the user then specifies the additional number to be added or multiplied. The program reports the latest sum/product.


Note:operator is a C++ reserved name (keyword). Do not use it as a variable name.




Test Case Output


Welcome to the math loop.


Give a first number:5


Choose an operation:+


Choose a number to add:6


5+6 = 11


Choose an operation:x


Choose a number to multiply:3


11x3 = 33


Choose an operation:x


Choose a number to multiply:2


33x2 = 66


Choose an operation:+


Choose a number to add:15


66+15 = 81


Choose an operation:q


We are finished!



Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here