The assignment is to write a C program that creates customers\' bill for a carpe
ID: 3628902 • Letter: T
Question
The assignment is to write a C program that creates customers' bill for a carpet company. For main I have:#include <my.h>
int main(void)
{
int length,width,area,discount;
double price,cost,charge,laborCharge,installed,amtDiscount,subtotal,amtTax,total;
printf("Enter length in feet: ");
scanf("%d",&length);
printf("Enter width in feet: ");
scanf("%d",&width);
printf("Enter the percentage discount: ");
scanf("%d",&discount);
printf("Enter carpet price per foot: ");
scanf("%lf",&price);
printf("MEASUREMENT ");
printf("Length %4d feet ",length);
printf("Width %4d feet ",width);
printf("Area %4d sq ft ",area);
printf(" CHARGES ");
printf("DESCRIPTION COST/SQ.FT. CHARGE/ROOM ");
printf("----------- ----------- ----------- ");
printf("Carpet %5.2f $%7.2f ",price,charge);
printf("Labor %.2f $%7.2f ",labor,laborCharge);
printf("--------- ");
printf("INSTALLED PRICE $%7.2f ",installed);
printf("Discount %2d%% $%7.2f ",discount,amtDiscount);
printf("--------- ");
printf("SUBTOTAL $%7.2f ",subtotal);
printf("Tax $%7.2f ",amtTax);
printf("TOTAL $%7.2f ",total);
return 0;
]
my.h is my header file h that includes:
#include <stdio.h>
#define LABOR_COST 0.35
#define TAX_RATE .085
void read_data( int* length, int* width, int* customerdiscount,
double* costpersquaregfoot)
void calculate_values( int length, int width, int customerdiscount,
double costpersquarefoot, int* area, double* carpetcharge, double*
laborcharge, double* installpricecharge, double* discountcharge, double*
subtotalcharge, double* taxcharge, double* totalcharge)
void calculate_installedprice( int length, int width, int
customerdiscount, double costpersquarefoot, int* area, double*
carpetcharge, double* laborcharge, double* installedpricecharge)
void calculate_subtotal( double* discountcharge, double*
subtotalcharge, double carpetcharge, double laborcharge)
void calculate_price( double* taxcharge, double* totalcharge, double
subtotalcharge)
void printresults( int lenth, int width, int area, double
carpetcharge, double laborcharge, double installedpricecharge, double
discountcharge, double subtotalcharge, double taxcharge, double
totalcharge)
void printmeasurements( int length, int width, int area)
void printcharges( double carpetcharge, double laborcharge, double
installedpricecharge, double discountcharge, double taxcharge, double
totalcharge)
Now, I am supposed to write 9 .c files. Main.c is one, but the other 8 are the functions. Such as function1.c, function2.c, function3.c, etc... How do I write main with these functions so that main works and what do I write in each respective new .c file for the functions, such as what do i write in function1.c?