write a program to compute a customer\'s bill. the program should request the qu
ID: 3536494 • Letter: W
Question
write a program to compute a customer's bill. the program should request the quantity of each item ordered in a sub procedure, calculate the total cost with a function procedure, and use a sub procedure to display an itemmized bill. the pizza is 1.75, drinks $1.75, ext write a program to compute a customer's bill. the program should request the quantity of each item ordered in a sub procedure, calculate the total cost with a function procedure, and use a sub procedure to display an itemmized bill. the pizza is 1.75, drinks $1.75, extExplanation / Answer
#include<stdio.h>
#define tax 8.25
#define TV_price 400.00
#define VCR_price 220.00
#define Remote_Controller_price 35.20
#define CD_Player_price 300.00
#define Tape_Recorder 150.00
void main()
{
int TV, VCR, Remote_Controller, CD_Player, Tape_Recorder;
float subtotal, total;
printf("How Many TVs Were Sold?: ");
scanf("&d" ,&TV);
printf("How Many VCRs Were Sold?: ");
scanf("&d" ,&VCR);
printf("How Many Remote Controllers Were Sold?: ");
scanf("&d" ,&Remote_Controller);
printf("How Many Cd Players Were Sold?: ");
scanf("&d" ,&CD_Player);
printf("How Many tape Recorders Were Sold?: ");
scanf("&d" ,&Tape_Recorder);
//total_price=quantity*total price
printf("QTY DESCRIPTION UNIT PRICE TOTAL PRICE ");
printf("=== =========== ========== =========== ");
printf("%d TV 400.00 " , TV , total_price );
printf("%d VCR 220.00 " , VCR ,total_price );
printf("%d Remote Controller 35.20 " , Remote_Controller , total_price );
printf("%d CD PLayer 300.00 " , CD_Player,total_price );
printf("%d Tape Recorder 150.00 " , Tape_Recorder ,total_price );
printf(" ----------- " );
printf(" SUBTOTAL %.2f " , subtotal);
printf(" TAX %.2f " , tax);
printf(" TOTAL %.2f " , total);
getch()
}
just replace the things that you want , otherwise it is almost similar. thanks
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.