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 Tshirts for $ each. Quantity discounts
are given to the first customers.
Total points
#include
using namespace std;
int main
int quantity;
double purchaseAmount, finalAmountPaid ;
for int count ; count ; count
cout ln Enter quantity: ;
cin gg quantity;
purchaseAmount quantity ;
discountAmount purchaseAmount ;
finalAmountPaid purchaseAmount discountAmount;
discount
You are going to modify and rewrite the main function on pages and Follow carefully the
instructions, if you want to get full credit. points
Step#: replace line Replace the for loop with a while loop. points
Step#: Replace lines and 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. points
Step#: Replace line Call the function "calculatePurchaseAmount" to calculate the purchase amount.
Description of the function: "calculatePurchaseAmount" will receive parameters: the
quantity and the Tshirt price. It will multiply the quantity times the Tshirt price and it will return
it to the main function points
Write the function on page
Step#: Replace line Call the function "calculateDiscount" to calculate the discount amount.
Description of the function: "calculateDiscount" will receive parameters: the quantity and the
Return the discount amount.
Write the function on page
points
do not change line that calculates the finalAmountPaid
Step#: Calculate the average finalAmountPaid. Hint: accumulate all finalAmountPaid and
divide by the number of customers points
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
