You are on page 1of 5

/*Title of micro project Supermarket Billing System */

/*Group from 45 to 54 */

/*sample input:2 2 0 5 7 5*/

#include<stdio.h>

#include<conio.h>

Int main()

Struct d{

Char nm[50];

Int pr;

};

Int i,j,choice,np,qt,sum=0,tot;

Char ch;

Struct d arr_d[43]={

/*dairy 0-6*/

{“Cow Milk (1 lit)”,40},

{“Buffalo Milk(1 lit)”,50},

{“toned milk(100ml)”,20},

{“Cheese (250 gm)”,99},

{“Butter (250 gm) “,289},

{“Paneer (250 gm)”,75},


{“Yogurt (50 gm)”,30},

/*animal product 7-12*/

{“lamb(1 Kg)”,399},

{“fish(250 gm)”,223},

{“Honey(250 gm)”, 77},

{“table-egg(1 unit)”,9},

{“regular-egg(1 unit)”,5},

{“Cardio_egg(1 unit)”,12},

/*fresh produce 13-22*/

{“Apple(1 Kg)”,151},

{“Pears(1Kg)”,169},

{“Bananas(1 doz)”,39},

{“Lychee(250 gm)”,75},

{“Avacado(250 gm)”,65},

{“Pineapple(1 piece)”,35},

{“Kivifruit(1 piece)”,12},

{“Strawberry(250 gm)”,150},

{“Alphonso(500gm)”,60},

{“grapes(500gm)”,30},

/*Dry fruits 23-29*/

{“Almond(50gm-packet)”,45},

{“Raisins(50gm-packet)”,10},

{“Cashew(50gm-packet)”,48},

{“Walnut(50gm-packet)”,55},
{“pecan nuts(50 gm-packet)”,99},

{“Dates(100gm-packet)”,34},

{“Figs(100gm-packet)”,179},

/*Snacks 30-35*/

{“Mad angles(40gm-pack)”,10},

{“Haldiram Bhujia(60gm-pack)”,10},

{“Instant Bhel(55gm-pack)”,10},

{“Moong Dal(30gm-pack)”,10},

{“coca cola(300ml-can)”,33},

{“sprite (300ml-can)”,39},

/*Everyday Goods 36-42 */

{“Toothbrush”,40},

{“Toothpaste(100gm)”,30},

{“Everyouth facewash(50gm)”,39},

{“Listerine(250 ml)”,125},

{“Parachute Oil(100ml)”,37},

{“Patanjali Soap(125 gm)”,25},

{“Patanjali Kesh kanti(200ml)”,75}

};/*struct initialization done*/

//clrscr(); for turbo c

Begin:

Printf(“1.To watch available products\n”);

Printf(“2.To make bill\n”);

Printf(“3.To exit\n”);

Scanf(“%d”,&choice);
/*To Watch products available*/

If(choice==1)

{ printf(“CODE \tPRODUCT \tPRICE\n”);

For(i=0;i<=42;i++)

Printf(“%d\t%s\t%d\n”

,i,arr_d[i].nm,arr_d[i].pr);

Printf(“b.To go back”);

Scanf(“\n%c”,&ch);

If(ch==’b’)

{ goto begin;}

/*To create bill*/

Else if(choice==2)

{printf(“How many products purchased ?”);

Scanf(“%d”,&np);

Printf(“\nenter required data\n”);

Printf(“\n\nCODE\t Product\t \tQt \n”);

For(j=1;j<=np;j++)

Scanf(“\n%d”,&i);

Printf(“\t%s\t”,arr_d[i].nm);

Scanf(“\t%d”,&qt);

Sum+=(arr_d[i].pr)*qt;

Tot=sum;

Printf(“\n\n”); printf(“\n**________BILL________**”);
Printf(“\n Total=%d Rs”,sum);

Printf(“\n GST=%f Rs”,sum*0.05);

/*GOODS AND SRVICES TAX */

If(sum>=1000)

Printf(“\nDiscount=%f”,sum*0.15); printf(“\nGrand total=%f”,

Sum+sum*(0.05-0.15));

Else{

Printf(“\nGrand total=%f”,

Sum+sum*0.15);

Printf(“\n\n\t\tTHANKS FOR VISITING”);

Else if(choice==3)

{goto end;}

End:

// getch();for turbo c

Return 0;

You might also like