Part 2: Formatting Output Consider the following program skeleton. * Author(s): .. * Date: * Title: Lab assignment 2a -- C++ Basics Lab assignment 2 * Specification: * This program will bring in two prices and two quantities of items from the keyboard and print those numbers in a formatted chart. #include iostream> N Fill in the code to bring in the library for formatted output. using namespace std; int main() { f loat price1, price2; / The price of 2 items int quantity1, quantity2: / The quantity of 2 items cout << setprecision(2) <« fixed << showpoint; cout << "Please input the price and quantity of the first item" << endl; II Fill in the input statement that reads in price1 and quantity1 from the keyboard. N Fill in the prompt for the second price and quantity. II Fill in the input statement that reads in price2 and quantity2 from the keyboard. cout << setw(15) << "PRICE" < setw(12) <« "QUANTITY\nin": II Fill in the output statement that prints the first price and quantity. Be sure to use // setw) statements. II Fill in the output statement that prints the second price and quantity. return 0: } Finish the code above by filling in the blanks and the instructions necessary to execute the following sample run. Note 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. · Attach the output screen of a successful execution of your program below (Hint:Use the snipping tool to take screenshots)
Part 2: Formatting Output Consider the following program skeleton. * Author(s): .. * Date: * Title: Lab assignment 2a -- C++ Basics Lab assignment 2 * Specification: * This program will bring in two prices and two quantities of items from the keyboard and print those numbers in a formatted chart. #include iostream> N Fill in the code to bring in the library for formatted output. using namespace std; int main() { f loat price1, price2; / The price of 2 items int quantity1, quantity2: / The quantity of 2 items cout << setprecision(2) <« fixed << showpoint; cout << "Please input the price and quantity of the first item" << endl; II Fill in the input statement that reads in price1 and quantity1 from the keyboard. N Fill in the prompt for the second price and quantity. II Fill in the input statement that reads in price2 and quantity2 from the keyboard. cout << setw(15) << "PRICE" < setw(12) <« "QUANTITY\nin": II Fill in the output statement that prints the first price and quantity. Be sure to use // setw) statements. II Fill in the output statement that prints the second price and quantity. return 0: } Finish the code above by filling in the blanks and the instructions necessary to execute the following sample run. Note 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. · Attach the output screen of a successful execution of your program below (Hint:Use the snipping tool to take screenshots)
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%

Transcribed Image Text:Part 2: Formatting Output
Consider the following program skeleton.
* Author(s): .
* Date:
* Title: Lab assignment 2a -- C++ Basics Lab assignment 2
* Specification:
* This program will bring in two prices and two quantities of items from the keyboard and
* print those numbers in a formatted chart. /
#include iostream>
I Fill in the code to bring in the library for formatted output.
using namespace std;
int main() {
f loat price1, price2:
I The price of 2 items
int quantity1, quantity2; / The quantity of 2 items
cout << setprecision(2) << fixed << showpoint;
cout << "Please input the price and quantity of the first item" << endl;
II Fill in the input statement that reads in price1 and quantity1 from the keyboard.
I Fill in the prompt for the second price and quantity.
I Fill in the input statement that reads in price2 and quantity2 from the keyboard.
cout << setw(15) < "PRICE" << setw(12) << "QUANTITYInin":
II Fill in the output statement that prints the first price and quantity. Be sure to use // setw) statements.
II Fill in the output statement that prints the second price and quantity.
return 0:
}
Finish the code above by filling in the blanks and the instructions necessary to execute the following sample run. Note 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.
· Attach the output screen of a successful execution of your program below (Hint:Use the snipping tool to take screenshots)
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images

Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education