Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++, please! You're the administrator of a school district and you have to purchase art supplies for kindergarteners in bulk for all schools in the

C++, please!

image text in transcribed

You're the administrator of a school district and you have to purchase art supplies for kindergarteners in bulk for all schools in the district based on their enrollment. You need to buy one art kit per student at $4.50, and you get a discount for all the kits, based on the number of art kits you purchase. Discount rates are as follows: Quantity Discount 100-199 10 % 200 - 399 15 % 400 - 599 20 % 600 or more 25 % Write a program that takes the number of students (integer) in the school district as input, and outputs the total cost (double) for buying art kits for each student, as shown in examples below. If user inputs negative values for the number of students, then print "Invalid input." The total cost should be formatted with a two-digit precision as shown below. You can use the setprecision function with the fixed manipulator from library to do so. Note: If you are failing a hidden test, your approach may be slightly different from the solution but still correct. A quick fix is to save your discount computation in float variable rather than a double. For example: Test Input Result //test case 1 - between 0 & 99 50 Enter the number of students in the school district: The total cost for buying art kits is $225.00 1/test case 2 - between 100 & 199 111 Enter the number of students in the school district: The total cost for buying art kits is $449.55 //test case 3 - invalid input -100 Enter the number of students in the school district: Invalid input. //test case 4 - greater than 600 1000 Enter the number of students in the school district: The total cost for buying art kits is $3375.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

Define Heideggers terms throwness, Mitwelt, and Umwelt.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago