Question: Please do in C + + The program below is about a clothing company that sold T - shirts for $ 1 9 . 5

Please do in C++
The program below is about a clothing company that sold T-shirts for $19.50 each. Quantity discounts
are given to the first 70 customers.
(Total 60 points)
#include
using namespace std;
int main (){
int quantity;
double purchaseAmount, finalAmountPaid ;
for ( int count =1; count =70; count ++){
cout "ln Enter quantity: ";
cin \gg> quantity;
purchaseAmount = quantity *19.50;
discountAmount = purchaseAmount *0.20;
finalAmountPaid = purchaseAmount - discountAmount;
}
//20% discount
You are going to modify and rewrite the main function on pages 3 and 4. Follow carefully the
instructions, if you want to get full credit. (15 points)
Step#1: (replace line 1) Replace the for loop with a while loop. (5 points)
Step#2: Replace lines 2 and 3. Call the function" inputQuantity to input the quantity. Description of the
function: "inputQuantity" will read one integer, validate it with a loop (quantity must be a positive
number) and return it to the main function. (10 points)
Step#3: Replace line 4. Call the function "calculatePurchaseAmount" to calculate the purchase amount.
Description of the function: "calculatePurchaseAmount" will receive 2 parameters: the
quantity and the T-shirt price. It will multiply the quantity times the T-shirt price and it will return
it to the main function (10 points)
Write the function on page 5.
Step#4: Replace line 5. Call the function "calculateDiscount" to calculate the discount amount.
Description of the function: "calculateDiscount" will receive 2 parameters: the quantity and the
Return the discount amount.
Write the function on page 6.
(10 points)
(do not change line 6) that calculates the finalAmountPaid
Step#5: Calculate the average finalAmountPaid. (Hint: accumulate all finalAmountPaid and
divide by the number of customers)(10 points)
Please do in C + + The program below is about a

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 Programming Questions!