Sunteți pe pagina 1din 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");

S-ar putea să vă placă și