Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a c program that creates customers\' bills for a carpet company when the f

ID: 3650066 • Letter: W

Question

write a c program that creates customers' bills for a carpet company when the following information is given:
a.the length and the width of the carpet in feet
b. the carpet price per square foot
c.the percent of discount for each customer
the labor cost to fixed at $0.35 per square foot. it is to be defined as a constant. the tax rate is 8.5% applied after the discoun. it is also to be defined as a constant . the input data consist of a set of three integer representing the length and width of the room to be carpeted , the percentage of the discount the owner gives to a customer , and a real number representing the unit price of the carpet. the program is to prompt the user for his input as shown below(colored numbers are typical responses)

length of room(feet)? 30
width of room(feet)? 18
customer discount(percent)? 8.23
the output is shown below. be careful to align the decimal points.
Measurement
Length xxx ft
Width xxx ft
Area xxx square ft
Charges
Description Cost/Sq.Ft Charge
Carpet xxx.xx $xxxx.xx
Labor 0.35 xxxx.xx

Installed Price $xxxx.xx
Discount xx% xxxx.xx

Subtotal $xxxx.xx
Tax xxxx.xx
Total $xxxx.xx

Ps: Please to be me a favor write all the numbers .i have no clues on how to do this stuff. i hate programming

Explanation / Answer

please rate - thanks

please rate the best answer first-thanks

#include <stdio.h>
#include <conio.h>
int main()
{ int l,w,area;
double drate,carpet,labor,cprice,installed,discount,sub,tax,cost;
printf("length of room(feet)? ");
scanf("%d",&l);
printf("width of room(feet)? ");
scanf("%d",&w);
printf("Carpet Price(sq ft)? ");
scanf("%lf",&cprice);
printf("customer discount(percent)? ");
scanf("%lf",&drate);
drate/=100.;
printf("Measurement ");
printf("Length %3d ft ",l);
printf("Width %3d ft ",w);
area=l*w;
printf("Area %4d square ft ",area);
printf("Charges ");
carpet=area*cprice;
labor=area*.35;
installed=carpet+labor;
discount=installed*drate;
sub=installed-discount;
tax=sub*.085;
cost=sub+tax;
printf("Description   Cost/Sq.Ft   Charge ");
printf("Carpet        $%5.2lf     $%6.2lf ",cprice,carpet);
printf("Labor           0.35       %6.2lf ",labor);
printf("Installed Price $%7.2f ",installed);
printf("Discount %3.2lf%% %7.2lf ",drate*100,discount);
printf("Subtotal $%7.2lf ",sub);
printf("Tax       %7.2lf ",tax);
printf("Total    $%7.2lf ",cost);

getch();
return 0;
}