forked from msraghavganesh/Hacktoberfest2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelp
144 lines (141 loc) · 3.7 KB
/
help
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#include <stdio.h>
#include <st
//Function to sign up
scanf("%s", &users[i].password);
for (j = 0; j < strlering.h>
#include <time.h>
#include<math.h>
//LOGIN PART
struct authentic
{
char username[50];
char password[50];
} users[20];n(users[i].password); j++)
{
if (isdigit(users[i].password[j]))
{
counter = 1;
}
}
if (counter
}
printf("Succesfully Registered!\n");
i++;
}
//function to login
void login()
{
char temp[50], temp1[50];
int us = 0;
printf("En== 0)
{
printf("Pasword too Weak, Enter strong password\n");
goto label;
us = 1;
printf("Enter password:\n");
scanf(
}
if(us != 1)
{
login();
}
}
void authenticate()
{
int temp;
int i = 1;
while (i)
{
printf("Enter 1 to Signup\nEnter 2 for login\n");
scanf("%d", &temp);
switch (temp)
{
case 1:
signup();
break;
case 2:
"%s", &temp1);
if (strcmp(temp1, users[i].password) == 0)
{
}
else
{
printf("Wrong password!\n");
login();
}
}
scanf("%s", &users[i].username);
printf("Enter a strong password\n");
label:
//structure to enter food item details
struct item
{
int avail;
int price;
} item[10];t %d \t\t %d\n", item[6].avail, item[6].price);
printf("Sa
item[1].price = 30;
item[2].price = 40;
item[3].price = 25;
item[4].price = 18;
item[5].priceitem[5].avail, item[5].price);
printf("Veg Puff \
lad \t %d \t\t %d\n", item[7].avail, item[7].price);
printf("Bonda \t %d \t\t %d\n", item[8].avail, item[8].price);
printf("Vada \t %d \t\t %d\n", item[9].avail, item[9].price);
}
//structer to e
//function to display menu
void display_menu()
{
item[0].price = 20;
item[8].price = 19;
item[9].price = 35;
int i = 0, temp1, temp2, bill = 0, order_next = 1, next_cust = 1;
while = 20;
item[6].price = 10;
item[7].price = 8;
item[8].price = 19;
item[9].price = 35;
printf("Snack:\n Item name: \t Available \t Price\n");
printf("Samosa \t %d \t\t %d\n", item[0].avail, item[0].price);
printf("Cutlet \t %d \t\t %d\n", item[1].avail, item[1].price);
printf("Sandwich \t %d \t\t %d\n", item[2].avail, item[2].price);
printf("Vada Pav \t %d \t\t %d\n", item[3].avail, item[3].price);
printf("Bhelpuri \t %d \t\t %d\n", item[4].avail, item[4].price);
printf("Dhokla \t %d \t\t %d\n",
printf("Ward number\n");
scanf("%d", &u[i].ward_num);
}
//asking coustmer for next order
while (order_next)
{
printf("To order do the following steps\n Press 0 for Samosa\n");
printf("Press 1 for Cutlet\n");
printf("Press 2 for Sandwich\n");
scanf("%d", &temp1);
printf("Update Current Available Items\n");
scanf("%d", &item[i].avail);
}
//fumction to give bill
void billing()
{
item[0].price = 20;
item[1].price = 30;
printf("Enter quantity\n");
scanf("%d", &temp2);
//to check availaly sorry!\n");
}
printf("Order one more item? Enter any non-zero value \n");
scanf("%d", &order_next);
}
if (u[i].ward_num != NULL)
{
printf("~~~~~~~~~~~~~~~~bility of the stock
if (item[temp1].avail >= temp2)
{
item[temp1].avail = item[temp1].avail - temp2;
bill = bill + (item[temp1].price) * temp2;
}
else
{