0% found this document useful (0 votes)
133 views2 pages

XXX

The document contains a C program that calculates the total price of electronic items sold including TVs, VCRs, remote controls, CD players, and tape recorders. The program prompts the user to input the quantity of each item sold, calculates the subtotal and tax, and prints a receipt showing the item descriptions, unit prices, quantities, and total prices.

Uploaded by

Safwan Saiful
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views2 pages

XXX

The document contains a C program that calculates the total price of electronic items sold including TVs, VCRs, remote controls, CD players, and tape recorders. The program prompts the user to input the quantity of each item sold, calculates the subtotal and tax, and prints a receipt showing the item descriptions, unit prices, quantities, and total prices.

Uploaded by

Safwan Saiful
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

/*group: 7*/

/*programmer: amir farhan b. saiful maznan*/


/*programmer: muhd amierul sazwan b. mat pauji*/
/*programmer: muhd saiful anuar b. salih*/
/*course&section: 1DDPP/06 */
/*date: 8/1/2015*/
#include<stdio.h>
int main()
{
int TV, VCR, RC, CD, TR;
float subtotal, total, a,b,c,d,e,tax;
char response;

printf("how many TVs were sold?:\n");


scanf("%d", &TV);

printf("how many VCRs were sold?:\n");


scanf("%d",&VCR);

printf("how many remote control were sold?:\n");


scanf("%d",&RC);

printf("how many cd player were sold?:\n");


scanf("%d",&CD);

printf("how many tape recorder were sold?:\n");


scanf("%d",&TR);
printf("\n\n");

a=400.00*TV;

b=220.00*VCR;
c=35.00*RC;
d=300.00*CD;
e=150.00*TR;

subtotal=a+b+c+d+e;

tax=0.0825*subtotal;
total=tax+subtotal;

printf("QTY

DESCRIPTION

UNIT PRICE

TOTAL PRICE\n");

printf("-------------------------------------------------------------------------------\n");
printf("%2d

TV

RM400.00

RM%8.2f

\n",TV,a);

printf("%2d

VCR

RM220.00

RM%8.2f

\n",VCR,b);

printf("%2d

Remote control

printf("%2d

CD player

printf("%2d

tape recorder

RM35.00
RM300.00
RM150.00

RM%8.2f
RM%8.2f
RM%8.2f

\n",RC,c);
\n",CD,d);
\n",TR,e);

printf("\n");
printf("

------------------------------------------\n");

printf("

SUBTOTAL

printf("

TAX

printf("

TOTAL

printf("

return 0;
}

** RM%8.2f **
** RM%8.2f **
** RM%8.2f **

\n",subtotal);
\n",tax);
\n",total);

-----------------------------------------\n");

You might also like