CS120-02, TSU Lab Objectives This lab was designed to reinforce programming concepts from Chapter 3 of C++ Programming: Program Design Including Data Structures, 8th Edition. In this lab you will practice: Input request Arithmetic calculations Formatted output Program 3: School Supply Due on Sunday, 9/25/2022, by 11:59pm Problem Description Supposed you have purchased school supply online for the new school year, but just found out there are still some items to buy. Write a program named Program3_SchoolSupply Your Name.cpp to calculate the payment for the items that you are to order. The following is the list of the items and the unit price. Sharpie fine point permanent marker $4.87/pack $3.60/pack • Classic medium point ball pen • Pencil case with secure zipper closure $10.55/each The sale rate is 8.25%. The number of items to buy should be input by user. Program Requirements The program should 1. request input to get your name 2. request inputs to get the quantity of each item you like to order 3. perform calculations for how much you need to pay for all items you have ordered 4. print the data in the required format, as I showed in the sample output Programming Steps 1. Start from this least C++ program: //Preprocessor directive 2 //Namespace definition 4 int main() 5-{ 7 8} Created by Li Ma return 0; CS120-02, TSU 2. print a program message "This is for Program3 by YourName." first. a. replace YourName with your own names b. add a line break by the end of the message 3. define the following variables and assign values to them: a. markerPrice, penPrice, casePrice, saleRate i. they are all floating-point values, either float type or double type ii. set value to these variables using the information in the problem description 4. ask user to enter the following values a. your name (userName) i. userName is a string, should be defined as string userName; ii. you should use the following statement to request a string getline (cin, userName); iii. it should be the first input request b. the number of packs for permanent marker (markerCount) as integer c. the number of packs for ball pen (penCount) as integer d. the number of pencil case (caseCount) as integer 5. calculate the payment (Payment), which is a floating-point value payment = (markerCount marker Price + penCount penPrice + caseCount casePrice) = (1 + saleRate) 6. display an output report like the following sample output: User's name: Sale rate: Number of permanent markers: Number of ball pen: Number of pencil case: Amount to pay: Note: there are three (3) columns $ Created by Li Ma Li Ma 8.25% 2 3 1 33.65 i. the left column is left aligned ii. the right column is right aligned iii. the dollar sign in the last row is in the middle column 7. format the output using manipulators, not just using white spaces or tab spaces. You may use the following manipulators a. endl, fixed, showpoint, right, left, and setw()

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
icon
Related questions
Question
100%

Please I need help to get this homework done, I am not sure how to build the program correctly. 

CS120-02, TSU
Lab Objectives
This lab was designed to reinforce programming concepts from Chapter 3 of C++ Programming:
Program Design Including Data Structures, 8th Edition. In this lab you will practice:
Input request
Arithmetic calculations
Formatted output
Program 3: School Supply
Due on Sunday, 9/25/2022, by 11:59pm
Problem Description
Supposed you have purchased school supply online for the new school year, but just found out there
are still some items to buy. Write a program named Program3_SchoolSupply Your Name.cpp to
calculate the payment for the items that you are to order. The following is the list of the items and the
unit price.
Sharpie fine point permanent marker
$4.87/pack
$3.60/pack
Pencil case with secure zipper closure
$10.55/each
The sale rate is 8.25%. The number of items to buy should be input by user.
. Classic medium point ball pen
Program Requirements
The program should
1. request input to get your name
2. request inputs to get the quantity of each item you like to order
3. perform calculations for how much you need to pay for all items you have ordered
4.
print the data in the required format, as I showed in the sample output
Programming Steps
1. Start from this least C++ program:
1 //Preprocessor directive
2 //Namespace definition
4 int main()
{
}
Created by Li Ma
return 0;
CS120-02, TSU
2. print a program message "This is for Program3 by Your Name." first.
a. replace YourName with your own names
b. add a line break by the end of the message
3. define the following variables and assign values to them:
a. markerPrice, penPrice, casePrice, saleRate
i. they are all floating-point values, either float type or double type
ii. set value to these variables using the information in the problem description
4. ask user to enter the following values
a. your name (userName)
i. userName is a string, should be defined as
string userName;
ii. you should use the following statement to request a string
getline (cin, userName);
iii. it should be the first input request
b.
e number of packs for permanent marker (markerCount) as integer
c. the number of packs for ball pen (penCount) as integer
d. the number of pencil case (caseCount) as integer
5. calculate the payment (Payment), which is a floating-point value
payment = (markerCount * marker Price + penCount * penPrice + caseCount * casePrice) * (1 + saleRate)
6. display an output report like the following sample output:
User's name:
Sale rate:
Number of permanent markers:
Number of ball pen:
Number of pencil case:
Amount to pay:
Note: there are three (3) columns
$
Created by Li Ma
Li Ma
8.25%
2
3
1
33.65
i. the left column is left aligned
ii. the right column is right aligned
iii. the dollar sign in the last row is in the middle column
7. format the output using manipulators, not just using white spaces or tab spaces. You may use
the following manipulators
a. endl, fixed, showpoint, right, left, and setw()
Transcribed Image Text:CS120-02, TSU Lab Objectives This lab was designed to reinforce programming concepts from Chapter 3 of C++ Programming: Program Design Including Data Structures, 8th Edition. In this lab you will practice: Input request Arithmetic calculations Formatted output Program 3: School Supply Due on Sunday, 9/25/2022, by 11:59pm Problem Description Supposed you have purchased school supply online for the new school year, but just found out there are still some items to buy. Write a program named Program3_SchoolSupply Your Name.cpp to calculate the payment for the items that you are to order. The following is the list of the items and the unit price. Sharpie fine point permanent marker $4.87/pack $3.60/pack Pencil case with secure zipper closure $10.55/each The sale rate is 8.25%. The number of items to buy should be input by user. . Classic medium point ball pen Program Requirements The program should 1. request input to get your name 2. request inputs to get the quantity of each item you like to order 3. perform calculations for how much you need to pay for all items you have ordered 4. print the data in the required format, as I showed in the sample output Programming Steps 1. Start from this least C++ program: 1 //Preprocessor directive 2 //Namespace definition 4 int main() { } Created by Li Ma return 0; CS120-02, TSU 2. print a program message "This is for Program3 by Your Name." first. a. replace YourName with your own names b. add a line break by the end of the message 3. define the following variables and assign values to them: a. markerPrice, penPrice, casePrice, saleRate i. they are all floating-point values, either float type or double type ii. set value to these variables using the information in the problem description 4. ask user to enter the following values a. your name (userName) i. userName is a string, should be defined as string userName; ii. you should use the following statement to request a string getline (cin, userName); iii. it should be the first input request b. e number of packs for permanent marker (markerCount) as integer c. the number of packs for ball pen (penCount) as integer d. the number of pencil case (caseCount) as integer 5. calculate the payment (Payment), which is a floating-point value payment = (markerCount * marker Price + penCount * penPrice + caseCount * casePrice) * (1 + saleRate) 6. display an output report like the following sample output: User's name: Sale rate: Number of permanent markers: Number of ball pen: Number of pencil case: Amount to pay: Note: there are three (3) columns $ Created by Li Ma Li Ma 8.25% 2 3 1 33.65 i. the left column is left aligned ii. the right column is right aligned iii. the dollar sign in the last row is in the middle column 7. format the output using manipulators, not just using white spaces or tab spaces. You may use the following manipulators a. endl, fixed, showpoint, right, left, and setw()
8. print a program message "This is done by YourName." on the bottom of the result output.
a. replace YourName with your own names
9. include the needed files for the pre-defined methods
a. iostream for cin, cout, and the manipulators without parameter
b. iomanip for the manipulators with parameter
c. string for using string type values
Problem-solving Tips
• You should define all variables in right data types:
o
userName is string type
o The variables for the unit price, sale rate, and payment are float or double type
o
The variables for the number of items to buy should be int type
• The sale rate is a percentage value. In the calculation you should use the real value
o A rate of 3.5% means that the real value is 0.035 (3.5/100)
Submission
Snapshot your compiler window after you successfully run your program, save the picture as
Program3_SchoolSupply Your Name.png. Please be aware that
1. your screenshot should always include the whole compiler window, not just the result pane
2. your result pane should be big enough that all output lines will show up
Submit both of your program Program3_School Supply Your Name.cpp (70%) and the picture
Program3_SchoolSupply_yourName.png (30%) to Blackboard via Program3 link in Assignments
section of the course page.
Transcribed Image Text:8. print a program message "This is done by YourName." on the bottom of the result output. a. replace YourName with your own names 9. include the needed files for the pre-defined methods a. iostream for cin, cout, and the manipulators without parameter b. iomanip for the manipulators with parameter c. string for using string type values Problem-solving Tips • You should define all variables in right data types: o userName is string type o The variables for the unit price, sale rate, and payment are float or double type o The variables for the number of items to buy should be int type • The sale rate is a percentage value. In the calculation you should use the real value o A rate of 3.5% means that the real value is 0.035 (3.5/100) Submission Snapshot your compiler window after you successfully run your program, save the picture as Program3_SchoolSupply Your Name.png. Please be aware that 1. your screenshot should always include the whole compiler window, not just the result pane 2. your result pane should be big enough that all output lines will show up Submit both of your program Program3_School Supply Your Name.cpp (70%) and the picture Program3_SchoolSupply_yourName.png (30%) to Blackboard via Program3 link in Assignments section of the course page.
Expert Solution
Step 1

The complete C++ code is given below with code and output screenshot

Happy to help ?

 

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education