This what my program is supposed to look like, can somone help me Enter length i
ID: 653599 • Letter: T
Question
This what my program is supposed to look like, can somone help me
Enter length in feet (integer): 23
Enter width in feet (integer): 13
Enter discount rate: 12
Enter Cost per square ft. (float): 14.20
MEASUREMENTS
Length 23 ft.
Width 13 ft.
Area 299 square ft.
CHARGES
DESCRIPTION COST PER SQ. FT. CHARGES
-------------------- -------------------------- ----------------
Carpet 14.20 $4245.80
Labor 0.35 $ 104.65
----------------
Installed Price $4350.45
Dsicount 12.00% $522.05
--------------------
SUBTOTAL $3828.40
TAX $325.41
TOTAL $4153.81
Thats what it should look like after u input the length, width discount rate and cost per sq. ft.
Can u please also include block comments in the programm and try and keep it simple for me since im not yet advanced at this.
Explanation / Answer
#include <stdio.h>
#include<conio.h>
int main()
{
float l, w, discount, cprice,lprice=0.35,a,cfc,Tax,T,subt,dp,cfl,ip;
char c='%';
clrscr();
printf("enter length in feet(integer)");
scanf("%f",&l);
printf("enter Width in feet(integer)");
scanf("%f",&w);
printf("enter Discount(float)");
scanf(" %f",&discount);
printf("Enter cost for square feet(carpet)");
scanf(" %f",&cprice);
printf(" MEASUREMENT ");
printf("Length %.2f ft ",l);
printf("Width %.2f ft ",w);
a=l*w;
printf("Area %.2f square ft ",a);
printf(" CHARGES DESCRIPTION COST SQ.FT. CHARGE ");
printf("----------- ----------- ------ ");
cfc=cprice*a;
printf("Carpet %.2f $%.2f ",cprice,cfc);
cfl=lprice*a;
printf("Labor %.2f $%.2f ",lprice,cfl);
ip=cfc+cfl;
printf(" ------- ");
printf("Installed price $%.2f ",ip);
dp=ip*(discount/100);
printf("discount %.2f%c $%.2f ",discount,c,dp);
subt=ip-dp;
printf(" ------ ");
printf("SUB TOTAL $%.2f ",subt);
Tax=subt*(8.5/100);
printf("TAX $%.2f ",Tax);
T=subt+Tax;
printf(" Total $%.2f",T);
}
follow the following steps
1} copy the program in notepad and save the save carpet.c
2} and complie the program
then u will get the output what you need
thank you
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.