Question: Complete/modify the code so that the C++ program will produce output similar to the following. Compile and debug the program until there are no syntax,

Complete/modify the code so that the C++ program will produce output similar to the following. Compile and debug the program until there are no syntax, runtime, or logic errors. Remember that two or more data items can be input at one time by having at least one blank space between them before hitting the enter key. SAMPLE RUN: Please input the price and quantity of the first item: 1.95 8 Please input the price and quantity of the second item: 10.85 9 PRICE QUANTITY 1.95 8 10.89 9 Submit the completed CPP file (not the EXE file) back to this assignment. /* This program will bring in two prices and two quantities of items * from the keyboard and print those numbers in a formatted chart. * * COSC-1436 Programming Fundamentals I * Professor Richard Herschede * Place your name here * Place today's date here */ #include #include //library for formatting output using namespace std; int main() { //declare variables double price1, price2; // The price of 2 items int quantity1, quantity2; // The quantity of 2 items //set up formatting cout << setprecision(2) << fixed << showpoint; //prompt for first item cout << "Please input the price and quantity of the first item: "; // Fill in the input statement that reads in price1 and // quantity1 from the keyboard. // Fill in the prompt for the second price and quantity. // Fill in the input statement that reads in price2 and // quantity2 from the keyboard. //display results cout << endl; cout << setw(15) << "PRICE" << setw(12) << "QUANTITY" << endl; // Fill in the output statement that prints the first price // and quantity. Be sure to use setw() statements. // Fill in the output statement that prints the second price // and quantity. return 0; } //end main()

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!