1. Member
Join Date
Apr 2012
Posts
3

#include<stdio.h>
#define tax 1.0825
#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_price 150.00

int main()
{
int TV, VCR, Remote_Controller, CD_Player, Tape_Recorder;
float price, subtotal, total, extTV=0, extVCR=0, extRemote_Controller=0, extCD_Player=0, extTape_Recorder=0, tax_deduct;

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);

extTV = TV * TV_price;
extVCR = VCR * VCR_price;
extRemote_Controller = Remote_Controller * Remote_Controller_price;
extCD_Player = CD_Player * CD_Player_price;
extTape_Recorder = Tape_Recorder * Tape_Recorder_price;

subtotal = extTV + extVCR +extRemote_Controller +extCD_Player + extTape_Recorder ;
tax_deduct= tax*subtotal;
total = subtotal + tax_deduct ;

printf("\nQTY DESCRIPTION UNIT PRICE TOTAL PRICE ");
printf("\n=== =========== ========== =========== ");

printf("\n%d TV 400.00 %.2f " , TV , extTV );
printf("\n%d VCR 220.00 %.2f " , VCR , extVCR);
printf("\n%d Remote Controller 35.20 %.2f " , Remote_Controller , extRemote_Controller);
printf("\n%d CD PLayer 300.00 %.2f " , CD_Player , extCD_Player );
printf("\n%d Tape Recorder 150.00 %.2f " , Tape_Recorder , extTape_Recorder );

printf("\n ----------- " );
printf("\n SUBTOTAL %.2f " , subtotal);
printf("\n TAX %.2f " , tax_deduct);
printf("\n TOTAL %.2f " , total);

getche();

}
Last edited by jessesaini; 18-04-2012 at 10:41 PM.

2. Member
Join Date
Apr 2012
Posts
3