The length and the width of a room are expressed


Write a c++ program to print a customers' bill.

-The length and the width of a room are expressed in term of meter and centimeters. for example, the length might be reported as 16.7meters.
-The store does not sell fractions of a meter. Thu, the length and width must always be rounded up.
-The carpet charge i equal to the number of square meters purchased times the carpet cost per square meter. Sales tax equal to 14% of the carpet cost must be added to the bill.
-The labour cost is equal to the number of square meter purchased times R24.00, which is labour cost per square meter. No tax is charged on labour.
-Each customer is identified by five-digit number, and that number should appear on the bill. Large-volume customers, identified by a customer number starting with '0', may be given a discount. The discount applies to the cost before sales tax is added.
-The sample output follows:
CROSSWELL CARPET STORE
STETEMENT
Customer name:XXXXX
Customer number: XXXXX

Carpet price:XX.XX
Labour : XX.XX

Subtotal : XX.XX
Less discount: XX.XX

Subtotal : XX.XX
Plus tax ; XX.XX
Total :XX.XX

program will consist of calculateCarpetSize takes as formal parameters the length and width of the room to be carperted a float point values and returns an integer representing the size of the room in square meters. Remember the store does not sell fraction numbers of meters. Thu the length and width of the room must always be rounded up.
-The function calculateCarpetCost takes as formal parameters the size of the room as well as the selling price of the carpet and returns the cost of the carpet.
-The function calculateLabourCost takes the size of the room as formal parameters and calculate the labour cost. The labour cost is equal to a number of square meters purchased times R24.00. Note that tax is charged on labour.
-The boolean function qualifyForDiscount uses the customer number to dertemine if the customer qualifies for a discount. All customers identified by a customer number starting with a zero('0') qualify for discount.
-computeDiscount returns the discount amount for which the customers qualifes. It first promts the user for the discount percentage and then calculates the discount.
-The final function printCustomerStatement takes as formal parameters the customer name, the customer number, the carpet and labour cost as well as the discount and prints the statement.(This function need not print out the statement on a printer. It can just display it on the screen.

Test the program with the following three customers:
-Mr. Wilson(customer 81429) ordered a carpet for his family room, which is 8.2 meters long and 6.8 meters wide. The carpet sells for R159.5 per meter.
-Mr. and Mrs. Adams(customer 04246) ordered carpeting for their bedroom, which measures 5 by 4 meters. The carpet sells R118.5 per square meter.
-Ms. Logan(customer 39050) ordered a carpet that cost R89.9 per square meter for her daughter's bedroom. The room is square, and is 4.5 meters wide.

Thi is what I have done so far

int main()
{
string customerNo;
string customerName;
float roomLength;
float roomWidth;
float sellingPrice;
float carpetCost;
float labourCost;
float discount;
int carpetSize;

cout<cout<<"n Please enter the following information:";
cout<<"n Customer name:";
cin>>customerName;
cout<<"n Customer Number:";
cin>>customerNo;
cout<<"n The length of the room:";
cin>>rommLenth;
cout<<"n The width of the room:";
cin>>roomWidth;
cout<<"n The carpet selling price:";
cin>>sellingPrice;

//call function calculateCarpetSize
//call function calculateCarpetCost
//call function calculateLabourCost

if(qualifyForDiscount(customerNo))
//call function computeDiscount
else
discount=0.0; 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: The length and the width of a room are expressed
Reference No:- TGS089215

Expected delivery within 24 Hours