हेलो दोस्तों !
आज की इस पोस्ट में हम simple shopping project को C programming language की मदद से बनाना सीखेंगे। तो दोस्तों अगर आप इस प्रोजेक्ट को बनाना सीखना चाहते है तो इस पोस्ट को अंत तक जरूर पढ़े।
इस पोस्ट के मुख्य टॉपिक्स निन्म है -
- project overview.
- important topics.
- important functions.
- project source code.
- project output video.
1.Project overview :-
2.Important topics :-
- graphics.
- user define function.
- loop - while loop.
- conditional statement - if else ,else if , goto.
3.Important functions :-
- initgraph()
- closegraph()
- rectange()
- line()
- setcolor()
- settextstyle()
- setlinestyle()
- outtextxy()
- delay()
4.Project source code :-
Shopping project source code :-
Note :- हैडर फाइल में जो स्पेस है वो हमने कुछ प्रॉब्लम के कारण दिया है इसलिए जब आप इसे अपने IDE पर रन करें तो स्पेस को इस प्रकार से हटा दे।
#include<stdio.h>#include<conio.h>#include<stdlib.h>#include<dos.h>#include<graphics.h>
#include< stdio.h >
#include< conio.h >
#include< stdlib.h >
#include< dos.h >
#include< graphics.h >
int checkOrder=0;
int wallet=5000;
char str[5];
char name[30]="AKSHAY";
char dob[15]="1-1-2000";
char gender[10]="Male";
char mobileNo[11]="4556464563";
char email[30]="akshay@gmail.com";
void userAccount(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(230,65,"USER ACCOUNT");
setcolor(4);
outtextxy(250,120,name);
outtextxy(240,180,dob);
outtextxy(260,230,gender);
outtextxy(220,280,mobileNo);
outtextxy(200,330,email);
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
line(80,110,550,110);
line(80,160,550,160);
line(80,210,550,210);
line(80,260,550,260);
line(80,310,550,310);
getch();
}
void userOrders(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(230,65,"YOUR ORDERS");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
line(80,100,550,100);
if(checkOrder==0){
outtextxy(200,230,"There's no order");
}else{
setcolor(4);
outtextxy(250,200,"You have");
sprintf(str,"%d",checkOrder);
outtextxy(300,230,str);
outtextxy(265,260,"Orders");
}
getch();
}
void userWallet(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(230,65,"YOUR WALLET");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
line(80,100,550,100);
if(wallet==0){
setcolor(4);
outtextxy(200,220,"There's no money in");
outtextxy(240,250,"Your wallet");
}else{
setcolor(4);
outtextxy(250,200,"You have");
sprintf(str,"%d",wallet);
outtextxy(280,230,str);
outtextxy(160,260,"Rupees in your wallet");
}
getch();
}
void deliveryAddress(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(220,65,"DELIVERY ADDRESS");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
line(80,100,550,100);
setcolor(4);
outtextxy(150,220,"MP-Phopal-House No 543");
outtextxy(170,250,"PIN Code - 453223");
getch();
}
void calculateOrder(){
char ch;
repeat:
ch=getch();
if(ch==13)
return;
else if(ch==49)
checkOrder++;
else if(ch==50)
checkOrder++;
else if(ch==51)
checkOrder++;
else if(ch==52)
checkOrder++;
else if(ch==53)
checkOrder++;
else if(ch==54)
checkOrder++;
else if(ch==55)
checkOrder++;
else if(ch==56)
checkOrder++;
goto repeat;
}
void groceryPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(225,60,"Grocery Item");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,110,"Press 1 To");
outtextxy(130,130,"Buy");
outtextxy(80,150,"Turmeric powder");
outtextxy(220,110,"Press 2 To");
outtextxy(240,130,"Buy");
outtextxy(220,150,"Dry fruits");
outtextxy(330,110,"Press 3 To");
outtextxy(350,130,"Buy");
outtextxy(330,150,"chocolate");
outtextxy(440,110,"Press 4 To");
outtextxy(470,130,"Buy");
outtextxy(425,150,"Protein powder");
outtextxy(100,210,"Press 5 To");
outtextxy(120,230,"Buy");
outtextxy(100,250,"Arhar dal");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy Salt");
outtextxy(330,230,"Press 7 To");
outtextxy(330,250,"Buy Ghee");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Oil");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void clothesPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(240,60,"Clothes");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(110,140,"Buy Shirt");
outtextxy(220,120,"Press 2 To");
outtextxy(220,140,"Buy Pant");
outtextxy(330,120,"Press 3 To");
outtextxy(325,140,"Buy T-Shirt");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Hanky");
outtextxy(100,230,"Press 5 To");
outtextxy(110,250,"Buy Lower");
outtextxy(220,230,"Press 6 To");
outtextxy(230,250,"Buy Tie");
outtextxy(330,230,"Press 7 To");
outtextxy(340,250,"Buy Cap");
outtextxy(440,230,"Press 8 To");
outtextxy(450,250,"Buy Hat");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void sportsPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(230,60,"Sports Item");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(115,140,"Buy Bat");
outtextxy(220,120,"Press 2 To");
outtextxy(225,140,"Buy Ball");
outtextxy(330,120,"Press 3 To");
outtextxy(330,140,"Buy Stamps");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Gloves");
outtextxy(100,230,"Press 5 To");
outtextxy(90,250,"Buy FootBall");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy Hockey");
outtextxy(330,230,"Press 7 To");
outtextxy(340,250,"Buy Cap");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Jersey");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void mobilesPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(230,60,"Mobile Phone");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(110,140,"Buy Sumsung");
outtextxy(220,120,"Press 2 To");
outtextxy(220,140,"Buy apple");
outtextxy(330,120,"Press 3 To");
outtextxy(335,140,"Buy OPPO");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy VIVO");
outtextxy(100,230,"Press 5 To");
outtextxy(100,250,"Buy REDMI");
outtextxy(220,230,"Press 6 To");
outtextxy(225,250,"Buy ONE+");
outtextxy(330,230,"Press 7 To");
outtextxy(340,250,"Buy Nokia");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Realme");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void kitchenPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(220,60,"Kitchen Item");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,110,"Press 1 To");
outtextxy(140,130,"Buy");
outtextxy(110,150,"Water pump");
outtextxy(220,120,"Press 2 To");
outtextxy(225,140,"Buy Jug");
outtextxy(330,120,"Press 3 To");
outtextxy(330,140,"Buy Glass");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Spoon");
outtextxy(100,230,"Press 5 To");
outtextxy(100,250,"Buy Plate");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy Cooker");
outtextxy(330,230,"Press 7 To");
outtextxy(340,250,"Buy Bottel");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Tiffin");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void beautyPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(220,60,"Beauty Product");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,110,"Press 1 To");
outtextxy(140,130,"Buy");
outtextxy(110,150,"Face wash");
outtextxy(220,110,"Press 2 To");
outtextxy(250,130,"Buy");
outtextxy(220,150,"Body lotion");
outtextxy(330,110,"Press 3 To");
outtextxy(360,130,"Buy");
outtextxy(330,150,"Coconut Oil");
outtextxy(440,110,"Press 4 To");
outtextxy(470,130,"Buy");
outtextxy(445,150,"Face powder");
outtextxy(100,230,"Press 5 To");
outtextxy(100,250,"Buy Comb");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy Mirror");
outtextxy(330,230,"Press 7 To");
outtextxy(330,250,"Buy Perfume");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Lipstick");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void toysPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(270,60,"Toys");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(110,140,"Buy Bullet");
outtextxy(220,110,"Press 2 To");
outtextxy(250,130,"Buy");
outtextxy(220,150,"Remote Car");
outtextxy(330,110,"Press 3 To");
outtextxy(360,130,"Buy");
outtextxy(330,150,"Rubic Cube");
outtextxy(440,110,"Press 4 To");
outtextxy(470,130,"Buy");
outtextxy(445,150,"Helicopter");
outtextxy(100,220,"Press 5 To");
outtextxy(140,240,"Buy");
outtextxy(100,260,"Teddy Bear");
outtextxy(220,220,"Press 6 To");
outtextxy(240,240,"Buy");
outtextxy(210,260,"Krish Statue");
outtextxy(330,220,"Press 7 To");
outtextxy(360,240,"Buy");
outtextxy(330,260,"Saktimaan");
outtextxy(440,220,"Press 8 To");
outtextxy(470,240,"Buy");
outtextxy(440,260,"Spider Man");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void shoesPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(270,60,"Shoes");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(110,140,"Buy Nike");
outtextxy(220,120,"Press 2 To");
outtextxy(220,140,"Buy Adidas");
outtextxy(330,120,"Press 3 To");
outtextxy(330,140,"Buy Puma");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Campus");
outtextxy(100,230,"Press 5 To");
outtextxy(100,250,"Buy Asian");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy T-Rock");
outtextxy(330,230,"Press 7 To");
outtextxy(330,250,"Buy Aadi");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Levi's");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void showMenu(){
int choose;
repeat:
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(235,60,"MAIN MENU");
setcolor(4);
outtextxy(225,100,"Your Account");
outtextxy(225,150,"Your Orders");
outtextxy(225,200,"Your Wallet");
outtextxy(210,250,"Delivery Address");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,130,550,130);
line(80,180,550,180);
line(80,230,550,230);
setcolor(6);
settextstyle(0,0,1);
outtextxy(210,320,"Press 1 to Show Your Account");
outtextxy(210,335,"Press 2 to Show Your Orders");
outtextxy(210,350,"Press 3 to Show Your Wallet");
outtextxy(210,365,"Press 4 to Show Delivery Address");
outtextxy(210,380,"Press 5 to Go Home Page");
fflush(stdin);
choose=getch();
switch(choose){
case 49:
userAccount();
goto repeat;
case 50:
userOrders();
goto repeat;
case 51:
userWallet();
goto repeat;
case 52:
deliveryAddress();
goto repeat;
case 53:
return;
default:
goto repeat;
}
}
int takeInput(){
char ch;
if(kbhit()){
ch=getch();
if(ch==49){
groceryPage();
}else if(ch==50){
clothesPage();
}else if(ch==51){
sportsPage();
}else if(ch==52){
mobilesPage();
}else if(ch==53){
kitchenPage();
}else if(ch==54){
beautyPage();
}else if(ch==55){
toysPage();
}else if(ch==56){
shoesPage();
}else if(ch=='m'||ch=='M'){
showMenu();
}else if(ch==27){
return 0;
}
}
return 1;
}
void drawBody(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(235,60,"HOME PAGE");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(100,120,"Press 1 To");
outtextxy(100,140,"Buy Grocery");
outtextxy(220,120,"Press 2 To");
outtextxy(220,140,"Buy Clothes");
outtextxy(330,120,"Press 3 To");
outtextxy(330,140,"Buy Sports");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Mobiles");
outtextxy(100,220,"Press 5 To");
outtextxy(100,240,"Buy Home");
outtextxy(220,220,"Press 6 To");
outtextxy(220,240,"Buy Beauty");
outtextxy(330,220,"Press 7 To");
outtextxy(330,240,"Buy Toys");
outtextxy(440,220,"Press 8 To");
outtextxy(440,240,"Buy Shoes");
settextstyle(0,0,2);
setcolor(6);
outtextxy(100,330,"Press 'M' to show Main Menu");
outtextxy(150,360,"Press 'Esc' to Exit");
}
void main(){
int gd=DETECT,gm,exit=1;
clrscr();
initgraph(&gd,&gm,"");
while(exit!=0){
drawBody();
exit=takeInput();
delay(500);
}
getch();
closegraph();
}
#include< stdio.h >
#include< conio.h >
#include< stdlib.h >
#include< dos.h >
#include< graphics.h >
int checkOrder=0;
int wallet=5000;
char str[5];
char name[30]="AKSHAY";
char dob[15]="1-1-2000";
char gender[10]="Male";
char mobileNo[11]="4556464563";
char email[30]="akshay@gmail.com";
void userAccount(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(230,65,"USER ACCOUNT");
setcolor(4);
outtextxy(250,120,name);
outtextxy(240,180,dob);
outtextxy(260,230,gender);
outtextxy(220,280,mobileNo);
outtextxy(200,330,email);
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
line(80,110,550,110);
line(80,160,550,160);
line(80,210,550,210);
line(80,260,550,260);
line(80,310,550,310);
getch();
}
void userOrders(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(230,65,"YOUR ORDERS");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
line(80,100,550,100);
if(checkOrder==0){
outtextxy(200,230,"There's no order");
}else{
setcolor(4);
outtextxy(250,200,"You have");
sprintf(str,"%d",checkOrder);
outtextxy(300,230,str);
outtextxy(265,260,"Orders");
}
getch();
}
void userWallet(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(230,65,"YOUR WALLET");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
line(80,100,550,100);
if(wallet==0){
setcolor(4);
outtextxy(200,220,"There's no money in");
outtextxy(240,250,"Your wallet");
}else{
setcolor(4);
outtextxy(250,200,"You have");
sprintf(str,"%d",wallet);
outtextxy(280,230,str);
outtextxy(160,260,"Rupees in your wallet");
}
getch();
}
void deliveryAddress(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(220,65,"DELIVERY ADDRESS");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
line(80,100,550,100);
setcolor(4);
outtextxy(150,220,"MP-Phopal-House No 543");
outtextxy(170,250,"PIN Code - 453223");
getch();
}
void calculateOrder(){
char ch;
repeat:
ch=getch();
if(ch==13)
return;
else if(ch==49)
checkOrder++;
else if(ch==50)
checkOrder++;
else if(ch==51)
checkOrder++;
else if(ch==52)
checkOrder++;
else if(ch==53)
checkOrder++;
else if(ch==54)
checkOrder++;
else if(ch==55)
checkOrder++;
else if(ch==56)
checkOrder++;
goto repeat;
}
void groceryPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(225,60,"Grocery Item");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,110,"Press 1 To");
outtextxy(130,130,"Buy");
outtextxy(80,150,"Turmeric powder");
outtextxy(220,110,"Press 2 To");
outtextxy(240,130,"Buy");
outtextxy(220,150,"Dry fruits");
outtextxy(330,110,"Press 3 To");
outtextxy(350,130,"Buy");
outtextxy(330,150,"chocolate");
outtextxy(440,110,"Press 4 To");
outtextxy(470,130,"Buy");
outtextxy(425,150,"Protein powder");
outtextxy(100,210,"Press 5 To");
outtextxy(120,230,"Buy");
outtextxy(100,250,"Arhar dal");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy Salt");
outtextxy(330,230,"Press 7 To");
outtextxy(330,250,"Buy Ghee");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Oil");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void clothesPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(240,60,"Clothes");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(110,140,"Buy Shirt");
outtextxy(220,120,"Press 2 To");
outtextxy(220,140,"Buy Pant");
outtextxy(330,120,"Press 3 To");
outtextxy(325,140,"Buy T-Shirt");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Hanky");
outtextxy(100,230,"Press 5 To");
outtextxy(110,250,"Buy Lower");
outtextxy(220,230,"Press 6 To");
outtextxy(230,250,"Buy Tie");
outtextxy(330,230,"Press 7 To");
outtextxy(340,250,"Buy Cap");
outtextxy(440,230,"Press 8 To");
outtextxy(450,250,"Buy Hat");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void sportsPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(230,60,"Sports Item");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(115,140,"Buy Bat");
outtextxy(220,120,"Press 2 To");
outtextxy(225,140,"Buy Ball");
outtextxy(330,120,"Press 3 To");
outtextxy(330,140,"Buy Stamps");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Gloves");
outtextxy(100,230,"Press 5 To");
outtextxy(90,250,"Buy FootBall");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy Hockey");
outtextxy(330,230,"Press 7 To");
outtextxy(340,250,"Buy Cap");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Jersey");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void mobilesPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(230,60,"Mobile Phone");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(110,140,"Buy Sumsung");
outtextxy(220,120,"Press 2 To");
outtextxy(220,140,"Buy apple");
outtextxy(330,120,"Press 3 To");
outtextxy(335,140,"Buy OPPO");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy VIVO");
outtextxy(100,230,"Press 5 To");
outtextxy(100,250,"Buy REDMI");
outtextxy(220,230,"Press 6 To");
outtextxy(225,250,"Buy ONE+");
outtextxy(330,230,"Press 7 To");
outtextxy(340,250,"Buy Nokia");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Realme");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void kitchenPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(220,60,"Kitchen Item");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,110,"Press 1 To");
outtextxy(140,130,"Buy");
outtextxy(110,150,"Water pump");
outtextxy(220,120,"Press 2 To");
outtextxy(225,140,"Buy Jug");
outtextxy(330,120,"Press 3 To");
outtextxy(330,140,"Buy Glass");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Spoon");
outtextxy(100,230,"Press 5 To");
outtextxy(100,250,"Buy Plate");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy Cooker");
outtextxy(330,230,"Press 7 To");
outtextxy(340,250,"Buy Bottel");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Tiffin");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void beautyPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(220,60,"Beauty Product");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,110,"Press 1 To");
outtextxy(140,130,"Buy");
outtextxy(110,150,"Face wash");
outtextxy(220,110,"Press 2 To");
outtextxy(250,130,"Buy");
outtextxy(220,150,"Body lotion");
outtextxy(330,110,"Press 3 To");
outtextxy(360,130,"Buy");
outtextxy(330,150,"Coconut Oil");
outtextxy(440,110,"Press 4 To");
outtextxy(470,130,"Buy");
outtextxy(445,150,"Face powder");
outtextxy(100,230,"Press 5 To");
outtextxy(100,250,"Buy Comb");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy Mirror");
outtextxy(330,230,"Press 7 To");
outtextxy(330,250,"Buy Perfume");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Lipstick");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void toysPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(270,60,"Toys");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(110,140,"Buy Bullet");
outtextxy(220,110,"Press 2 To");
outtextxy(250,130,"Buy");
outtextxy(220,150,"Remote Car");
outtextxy(330,110,"Press 3 To");
outtextxy(360,130,"Buy");
outtextxy(330,150,"Rubic Cube");
outtextxy(440,110,"Press 4 To");
outtextxy(470,130,"Buy");
outtextxy(445,150,"Helicopter");
outtextxy(100,220,"Press 5 To");
outtextxy(140,240,"Buy");
outtextxy(100,260,"Teddy Bear");
outtextxy(220,220,"Press 6 To");
outtextxy(240,240,"Buy");
outtextxy(210,260,"Krish Statue");
outtextxy(330,220,"Press 7 To");
outtextxy(360,240,"Buy");
outtextxy(330,260,"Saktimaan");
outtextxy(440,220,"Press 8 To");
outtextxy(470,240,"Buy");
outtextxy(440,260,"Spider Man");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void shoesPage(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(270,60,"Shoes");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(110,120,"Press 1 To");
outtextxy(110,140,"Buy Nike");
outtextxy(220,120,"Press 2 To");
outtextxy(220,140,"Buy Adidas");
outtextxy(330,120,"Press 3 To");
outtextxy(330,140,"Buy Puma");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Campus");
outtextxy(100,230,"Press 5 To");
outtextxy(100,250,"Buy Asian");
outtextxy(220,230,"Press 6 To");
outtextxy(220,250,"Buy T-Rock");
outtextxy(330,230,"Press 7 To");
outtextxy(330,250,"Buy Aadi");
outtextxy(440,230,"Press 8 To");
outtextxy(440,250,"Buy Levi's");
settextstyle(0,0,2);
setcolor(6);
outtextxy(120,350,"Press Enter key to go back");
calculateOrder();
}
void showMenu(){
int choose;
repeat:
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(2);
outtextxy(235,60,"MAIN MENU");
setcolor(4);
outtextxy(225,100,"Your Account");
outtextxy(225,150,"Your Orders");
outtextxy(225,200,"Your Wallet");
outtextxy(210,250,"Delivery Address");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,130,550,130);
line(80,180,550,180);
line(80,230,550,230);
setcolor(6);
settextstyle(0,0,1);
outtextxy(210,320,"Press 1 to Show Your Account");
outtextxy(210,335,"Press 2 to Show Your Orders");
outtextxy(210,350,"Press 3 to Show Your Wallet");
outtextxy(210,365,"Press 4 to Show Delivery Address");
outtextxy(210,380,"Press 5 to Go Home Page");
fflush(stdin);
choose=getch();
switch(choose){
case 49:
userAccount();
goto repeat;
case 50:
userOrders();
goto repeat;
case 51:
userWallet();
goto repeat;
case 52:
deliveryAddress();
goto repeat;
case 53:
return;
default:
goto repeat;
}
}
int takeInput(){
char ch;
if(kbhit()){
ch=getch();
if(ch==49){
groceryPage();
}else if(ch==50){
clothesPage();
}else if(ch==51){
sportsPage();
}else if(ch==52){
mobilesPage();
}else if(ch==53){
kitchenPage();
}else if(ch==54){
beautyPage();
}else if(ch==55){
toysPage();
}else if(ch==56){
shoesPage();
}else if(ch=='m'||ch=='M'){
showMenu();
}else if(ch==27){
return 0;
}
}
return 1;
}
void drawBody(){
clrscr();
setcolor(14);
settextstyle(0,0,2);
outtextxy(100,20,"WELCOME TO SHOPPING PROJECT");
setcolor(10);
outtextxy(235,60,"HOME PAGE");
setcolor(1);
setlinestyle(0,1,3);
rectangle(80,50,550,400);
rectangle(80,80,550,300);
line(80,185,550,185);
line(200,80,200,300);
line(310,80,310,300);
line(420,80,420,300);
settextstyle(0,0,1);
setcolor(4);
outtextxy(100,120,"Press 1 To");
outtextxy(100,140,"Buy Grocery");
outtextxy(220,120,"Press 2 To");
outtextxy(220,140,"Buy Clothes");
outtextxy(330,120,"Press 3 To");
outtextxy(330,140,"Buy Sports");
outtextxy(440,120,"Press 4 To");
outtextxy(440,140,"Buy Mobiles");
outtextxy(100,220,"Press 5 To");
outtextxy(100,240,"Buy Home");
outtextxy(220,220,"Press 6 To");
outtextxy(220,240,"Buy Beauty");
outtextxy(330,220,"Press 7 To");
outtextxy(330,240,"Buy Toys");
outtextxy(440,220,"Press 8 To");
outtextxy(440,240,"Buy Shoes");
settextstyle(0,0,2);
setcolor(6);
outtextxy(100,330,"Press 'M' to show Main Menu");
outtextxy(150,360,"Press 'Esc' to Exit");
}
void main(){
int gd=DETECT,gm,exit=1;
clrscr();
initgraph(&gd,&gm,"");
while(exit!=0){
drawBody();
exit=takeInput();
delay(500);
}
getch();
closegraph();
}
5.Project output video :-
तो दोस्तों अगर आपको इस प्रोजेक्ट का आउटपुट देखना है की यह प्रोजेक्ट कैसे वर्क कर रहा है इसके अंदर कौन कौन से फीचर्स है। तो इसके लिए आप हमारी वीडियो you tube पर देख सकते है। इस वीडियो में हमने इस प्रोजेक्ट के source code को भी दिखाया है और साथ में इस प्रोजेक्ट को रन करके दिखाया है तो अगर आप इस वीडियो को देखना चाहते है नीचे क्लिक करके देख सकते है।
इन पोस्ट को भी पढ़े -
- Store billing system project in c.
- Contact management system project in c.
- simple text editor project in c.
Author :- तो दोस्तों अब हमारी यह पोस्ट ख़त्म होती है। हम आशा करते है की आपको हमारी यह पोस्ट पसंद आई होगी और साथ में आप इस simple shopping project को C programming language की मदद से बनाना सीख गए होंगे। तो दोस्तों आज के लिए बस इतना ही फिर मिलेंगे ऐसी ही किसी और मजेदार पोस्ट में तब तक के लिए अलविदा।
0 Comments
Do not enter any spam comments please.