Question: C++ Assignment1A: Math Mad Libs: In traditional Mad Libs, you're given a paragraph of text with blanks; you then fill in those blanks to create

C++
C++ Assignment1A: Math Mad Libs: In traditional Mad Libs, you're given a

Assignment1A: Math Mad Libs: In traditional Mad Libs, you're given a paragraph of text with blanks; you then fill in those blanks to create an amusing or silly story. In this program, we will do the same thing - but with numbers! You will print out the following equation as a string literal: x + (y/z) *w = ? You will then prompt the user to enter one number at a time, replacing the variables from left to write with those numbers and printing the updated string to the screen. After the last number is entered, you will print the full equation with the solution replacing the "?" question mark. A sample output from this program is as shown below, with user input in bold. Your program's output must match this format, but it should work for any valid user input. Save your source code in a file called Assignment1A (with a file extension of.cpp, .cs or java) Sample Output: [Math Mad Libs] X + (y / z) * W = ? Enter the first term: 3 3 + (y / z) * W = ? Enter the second term: 4.3 3 + (4.3 / z) w = ? Enter the third term: -2 3+ (4.3 / -2) * W = ? Enter the fourth term: 7.8 3+ (4.3 / -2) 7.8 = -13.77 Note: Use a floating point variable to store each value entered by the user. Depending on your programming language, you may or may not have a decimal value displayed when entering a whole number (for instance, entering 5 may print out 5.0). Both formats are acceptable for this assignment. Also, you can assume the user will not input "O" for the third term. We will learn how to handle logical issues like this a little later in the course

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!