TEXSHO ONLINE DRESS PURCHASING SITE PROCESS PROGRAMED BY C.
Abstract:
This program is designed to make it easy for the user to buy dresses from the textile. the program is designed so that the user can select what they want to purchase,and the program is designed so that the user can choose the brand ,Size and the quantity of clothes they buy this program is designed using looping to start the program again if the user wants to buy again after the purchasing Just like how a clothing store or any online shopping application gives some discount if the user buys above a certain amount,We have designed some offers into this program.Since we don't use data base in this program,we use the variable inside the program to see the price of all dress .
SOURCE CODE :
#include<stdio.h>
void main()
{
int sec_op,brnd_op,size_op,siz_op,n_o_s,n_o_p,choice=1,n_o_d;
float c_o_b_d,c_o_p_s=1200,c_o42_p_s=1400,c_o4_p_s=1300,c_o4_as_s=1300,c_o_as_s=1100,c_o42_as_s=1200,t_amt,total_cost=0,c_o_1d_p=880,c_o_2d_s=990,c_o_jp32_s=800,c_o_jp34_s=900, c_o_jp40_s=990,c_o_lp32_s=400 ,c_o_lp34_s=450, c_o_lp40_s=600, c_o_3d_s=1100,c_o_ad1_s=990,c_o_ad2_s=999,c_o_ad3_s=1250,c_o_cp32_s=770,c_o_cp34_s=880,c_o_cp40_s=990;
// First we enter the prices for all the items,because every time the user buys that item ,we will give the price by default.
// Remember that the variable name must be unique.
system("color 0A");
printf("~~~~~~~ AK textile ~~~~~~~~\n");
while (choice<2){
printf("\tSEC - 1 [SHIRTS]\n");
printf("\tSEC - 2 [DHOTHIS]\n");
printf("\tSEC - 3 [PANTS]\n");
printf("ENTER THE SECTION : ");
scanf("%d",&sec_op); //here we take a user input what dress the user is going to buy.
if (sec_op==1)
{
printf("\t 1.otto\t,2.allen solly\n");
printf("SELECT THE BRAND :");
scanf("%d",&brnd_op); //here we will take a user input what brand the user wants to buy that dress.
if(brnd_op==1)
{
printf("\t BRAND OttO\n");
printf("\t SELECT THE AVALABLE SIZE '38','40','42'\t :"); //Let us default here to three sizes as the size in the available.
scanf("%d",&siz_op);
if(siz_op==38)
{
printf("NO:OF:SHIRTS: ");
scanf("%d",&n_o_s);
c_o_b_d=c_o_p_s*n_o_s;
total_cost=total_cost+c_o_b_d;
//total_cost=total_cost+c_o_b_d;
(Here we use it total_cost add up the price of the dress each time the user buys and when the user wants enough this calculation its used to display the total price.
printf("\purchase cost :%.2f\n",c_o_b_d);
}
else if(siz_op==40)
{
printf("NO:OF:SHIRTS: ");
scanf("%d",&n_o_s);
c_o_b_d=c_o4_p_s*n_o_s;
total_cost=total_cost+c_o_b_d;
printf("\t purchase cost :%.2f\n",c_o_b_d);
}
else if(siz_op==42)
{
printf("NO:OF:SHIRTS: ");
scanf("%d",&n_o_s);
c_o_b_d=c_o42_p_s*n_o_s;
total_cost=total_cost+c_o_b_d;
printf("\t purchase cost :%.2f\n",c_o_b_d);
}
else{
printf("SIZE UN AVAILABLE\n");
}
}
else if(brnd_op==2)
{
printf("\t Allen Solly\n");
printf("\t SELECT THE AVALABLE SIZE '38','40','42'\t :");
scanf("%d",&siz_op);
if(siz_op==38)
{
printf("NO:OF:SHIRTS: ");
scanf("%d",&n_o_s);
c_o_b_d=c_o_as_s*n_o_s;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost:%.2f\n",c_o_b_d);
// printf("\t\t TOTAL COST :%.2f\n",total_cost);
}
else if(siz_op==40)
{
printf("NO:OF:SHIRTS: ");
scanf("%d",&n_o_s);
c_o_b_d=c_o4_as_s*n_o_s;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost:%.2f\n",c_o_b_d);
// printf("\t\t TOTAL COST :%.2f\n",c_o_b_d);
}
else if(siz_op==42)
{
printf("NO:OF:SHIRTS: ");
scanf("%d",&n_o_s);
c_o_b_d=c_o42_as_s*n_o_s;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost:%.2f\n",c_o_b_d);
}
else{
printf("SIZE UN AVAILABLE\n");
//If the user enters anything other than its programmed things likes brand ,dress and its sizes .they are not programmed so they are programmed to print on {SIZE NOT AVILABLE ,BRAND NOT AVILABLE ,SECTION NOT AVILABLE.}
}
}
else
{
printf("BRAND UN AVAILABLE\n");
}
}
else if (sec_op==2)
{
printf("\t 1.RAMRAJ\t,2.ALAYA\n");
printf("SELECT THE BRAND :");
scanf("%d",&brnd_op);
if(brnd_op==1)
{
printf("\t Ramraj brand\n");
printf("\t SELECT THE AVALABLE SIZE 1.(4*8) \t2.(4*16\t 3.(VELCRO DHOTHI 4*8) :");
scanf("%d",&siz_op);
if(siz_op==1)
{
printf("NO:OF:DHOTHIS: ");
scanf("%d",&n_o_d);
c_o_b_d=c_o_1d_p*n_o_d;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost :%.2f\n",c_o_b_d);
}
else if(siz_op==2)
{
printf("NO:OF:DHOTHIS: ");
scanf("%d",&n_o_d);
c_o_b_d=c_o_2d_s*n_o_d;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost :%.2f\n",c_o_b_d);
}
else if(siz_op==3)
{
printf("NO:OF:DHOTHIS: ");
scanf("%d",&n_o_d);
c_o_b_d=c_o_3d_s*n_o_s;
total_cost=total_cost+c_o_b_d;
printf("\t purchase cost :%.2f\n",c_o_b_d);
}
else{
printf("SIZE UN AVAILABLE\n");
}
}
else if(brnd_op==2)
{
printf("\t Alaya\n");
printf("\t SELECT THE AVALABLE SIZE 1.'4*8',2.'4*16',3.'VELCRO DHOTHI 4*8'\t :");
scanf("%d",&siz_op);
if(siz_op==1)
{
printf("NO:OF:DHOTHIS: ");
scanf("%d",&n_o_d);
c_o_b_d=c_o_ad1_s*n_o_d;
total_cost=total_cost+c_o_b_d;
printf("\tprice cost:%.2f\n",c_o_b_d);
// printf("\t\t TOTAL COST :%.2f\n",total_cost);
}
else if(siz_op==2)
{
printf("NO:OF:DHOTHIS: ");
scanf("%d",&n_o_d);
c_o_b_d=c_o_ad2_s*n_o_d;
total_cost=total_cost+c_o_b_d;
printf("\t price cost:%.2f\n",c_o_b_d);
// printf("\t\t TOTAL COST :%.2f\n",c_o_b_d);
}
else if(siz_op==3)
{
printf("NO:OF:DHOTHI: ");
scanf("%d",&n_o_d);
c_o_b_d=c_o_ad3_s*n_o_d;
total_cost=total_cost+c_o_b_d;
printf("\tprice cost :%.2f\n",c_o_b_d);
}
else{
printf("SIZE UN AVAILABLE\n");
}
}
else
{
printf("BRAND UN AVAILABLE\n");
}
}
if (sec_op==3)
{
printf("\t 1.COTTON\t,2.JEANS 3.LYCRA\n");
printf("SELECT THE MATERIAL :");
scanf("%d",&brnd_op);
if(brnd_op==1)
{
printf("\t COTTON \n");
printf("\t SELECT THE AVALABLE SIZE '32','34','40'\t :");
scanf("%d",&siz_op);
if(siz_op==32)
{
printf("NO:OF:PANTS: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_cp32_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost :%.2f\n",c_o_b_d);
}
else if(siz_op==34)
{
printf("NO:OF:PANTS: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_cp34_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost :%.2f\n",c_o_b_d);
}
else if(siz_op==40)
{
printf("NO:OF:PANTS: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_cp34_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost :%.2f\n",c_o_b_d);
}
else{
printf("SIZE UN AVAILABLE\n");
}
}
else if(brnd_op==2)
{
printf("\t JEANS \n");
printf("\t SELECT THE AVALABLE SIZE '32','34','40'\t :");
scanf("%d",&siz_op);
if(siz_op==32)
{
printf("NO:OF:PANTS: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_jp32_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\tprice cost:%.2f\n",c_o_b_d);
// printf("\t\t TOTAL COST :%.2f\n",total_cost);
}
else if(siz_op==34)
{
printf("NO:OF:pants: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_jp34_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\tprice cost :%.2f\n",c_o_b_d);
// printf("\t\t TOTAL COST :%.2f\n",c_o_b_d);
}
else if(siz_op==40)
{
printf("NO:OF:PANTS: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_jp40_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\tprice cost :%.2f\n",c_o_b_d);
}
else{
printf("SIZE UN AVAILABLE\n");
}
}
else if(brnd_op==3)
{
printf("\t LYCRA \n");
printf("\t SELECT THE AVALABLE SIZE '32','34','40'\t :");
scanf("%d",&siz_op);
if(siz_op==32)
{
printf("NO:OF:PANTS: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_lp32_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\tprice cost:%.2f\n",c_o_b_d);
// printf("\t\t TOTAL COST :%.2f\n",total_cost);
}
else if(siz_op==34)
{
printf("NO:OF:pants: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_lp34_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\tprice cost:%.2f\n",c_o_b_d);
// printf("\t\t TOTAL COST :%.2f\n",c_o_b_d);
}
else if(siz_op==40)
{
printf("NO:OF:PANTS: ");
scanf("%d",&n_o_p);
c_o_b_d=c_o_lp40_s*n_o_p;
total_cost=total_cost+c_o_b_d;
printf("\purchase cost :%.2f\n",c_o_b_d);
}
else
{
printf("BRAND UN AVAILABLE\n");
}
}
else{
printf("SECTION NOT AVAILABLE");
}
}
printf(" \n---------- -- ---- - YOU WANT TO CONTINUE THE PURCHAE - ---- -- ------------\n");
printf("YES =1\t NO =2\n\n ");
scanf("%d",&choice);
}
//printf(" Total amount :%.2f\n",total_cost);
if(total_cost>=10000)
{
//Total cost of clothes purchased by the user was above 10000 rupees .the programm i designed to offer a discount of 8percentage from the total cost .like a festival offer.
t_amt=(total_cost*8)/100;
printf(" Total amount :%.2f\n",total_cost);
total_cost=total_cost-t_amt;
printf("THE DISCOUNT AMOUNT IS :%.2f\n",t_amt);
printf("----------------------------------\n");
printf(" TOTAL AMOUNT :%.2f\n",total_cost);
printf("-----------------------------------\n");
printf(" \n >>>>>>>>>>>>>>>>>>>>>>>>>>>>> THANK YOU <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ");
}
else
{
//If the total cost of the purchased dress is less than 10 thousand rupees,the program will print total cost only without any discount.
printf("----------------------------------\n");
printf(" TOTAL AMOUNT\t :%.2f\n",total_cost);
printf("-----------------------------------\n");
printf(" \t\t >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> THANK YOU <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ");
}
}
In this output i will run only some of contents .Any one want to check or need any understanding just copy the whole code and run it on any ide .is there any error was aries please comment me for alter it.💡
______________________________________________________________________________________________________________________________________________________________________
OUTPUT
WITHOUT DISCOUNT
~~~~~~~ AK textile ~~~~~~~~
SEC - 1 [SHIRTS]
SEC - 2 [DHOTHIS]
SEC - 3 [PANTS]
ENTER THE SECTION : 1
1.otto ,2.allen solly
SELECT THE BRAND :1
BRAND OttO
SELECT THE AVALABLE SIZE '38','40','42' :38
NO:OF:SHIRTS: 2
purchase cost :2400.00
---------- -- ---- - YOU WANT TO CONTINUE THE PURCHAE - ---- -- ------------
YES =1 NO =2
1
SEC - 1 [SHIRTS]
SEC - 2 [DHOTHIS]
SEC - 3 [PANTS]
ENTER THE SECTION : 2
1.RAMRAJ ,2.ALAYA
SELECT THE BRAND :2
Alaya
SELECT THE AVALABLE SIZE 1.'4*8',2.'4*16',3.'VELCRO DHOTHI 4*8' :1
NO:OF:DHOTHIS: 2
price cost:1980.00
---------- -- ---- - YOU WANT TO CONTINUE THE PURCHAE - ---- -- ------------
YES =1 NO =2
2
----------------------------------------
TOTAL AMOUNT :4380.00
----------------------------------------
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> THANK YOU <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
___________________________________________________________________________________
WITH DISCOUNT
~~~~~~~ AK textile ~~~~~~~~
SEC - 1 [SHIRTS]
SEC - 2 [DHOTHIS]
SEC - 3 [PANTS]
ENTER THE SECTION : 1
1.otto ,2.allen solly
SELECT THE BRAND :2
Allen Solly
SELECT THE AVALABLE SIZE '38','40','42' :38
NO:OF:SHIRTS: 10
purchase cost:11000.00
---------- -- ---- - YOU WANT TO CONTINUE THE PURCHAE - ---- -- ------------
YES =1 NO =2
1
SEC - 1 [SHIRTS]
SEC - 2 [DHOTHIS]
SEC - 3 [PANTS]
ENTER THE SECTION : 2
1.RAMRAJ ,2.ALAYA
SELECT THE BRAND :1
Ramraj brand
SELECT THE AVALABLE SIZE 1.(4*8) 2.(4*16 3.(VELCRO DHOTHI 4*8) :1
NO:OF:DHOTHIS: 20
Purchase cost :17600.00
---------- -- ---- - YOU WANT TO CONTINUE THE PURCHAE - ---- -- ------------
YES =1 NO =2
2
Total amount :28600.00
THE DISCOUNT AMOUNT IS :2288.00
--------------------------------------
TOTAL AMOUNT :26312.00
--------------------------------------
-------------------------------THANK YOU-----------------------------------------
Nice one.
ReplyDelete