-
Notifications
You must be signed in to change notification settings - Fork 28
/
TourismManagement.c
245 lines (221 loc) · 4.46 KB
/
TourismManagement.c
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
// C program to implement
// the above approach
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Defining Structure
typedef struct mynode {
char name[20];
char gen[6];
int age;
struct mynode* link;
} Node;
Node* start = NULL;
// Declaring Function Used
// In This Program
void heading();
void details();
void inter();
void india();
void receipt();
// Global variables
int k, amount;
char type[60], place[30], date[20];
// Driver Code
void main()
{
int a;
// Calling heading() function
heading();
// Taking Choice From User
printf("\t\t\t\t1. International "
"Tour Packages\n");
printf("\t\t\t\t2. India Tour Packages\n");
printf("\t\t\t\tEnter Choice: ");
scanf("%d", &a);
switch (a) {
// Calling inter() function
case 1:
inter();
break;
// Calling india() function
case 2:
india();
break;
default:
printf("Enter Right Choice...");
break;
}
// Calling details() function
details();
// Calling receipt() function
receipt();
}
// Function To Take Package
// Choice From India
void india()
{
int a;
// Clearing Screen
system("cls");
// Calling heading() function
heading();
strcpy(type, "India Tour Package");
printf("\t\t\t\t1. Shimla Tour Packages "
"6 Days 7 Nights (18880/-)\n");
printf("\t\t\t\t2. Kashmir Tour Packages "
"5 Days 4 Nights (35500/-)\n");
printf("\t\t\t\t3. Kolkata Tour Packages "
"11 Days 10 Nights (10000/-)\n");
printf("\t\t\t\tEnter Choice: ");
scanf("%d", &a);
if (a == 1) {
strcpy(place, "Shimla Tour");
amount = 18880;
}
else if (a == 2) {
strcpy(place, "Kashmir Tour");
amount = 35500;
}
else if (a == 3) {
strcpy(place, "Kolkata Tour");
amount = 10000;
}
else
printf("Enter Correct Choice...");
}
// Function To Take Package Choice
// From International
void inter()
{
int a;
// Clearing Screen
system("cls");
// Calling heading() function
heading();
strcpy(type, "International Tour Package");
printf("\t\t\t\t1. England Tour Packages "
"6 Days 7 Nights (28880/-)\n");
printf("\t\t\t\t2. Thailand Tour Packages "
"5 Days 4 Nights (15500/-)\n");
printf("\t\t\t\t3. New York Tour Packages "
"11 Days 10 Nights (567800/-)\n");
printf("\t\t\t\tEnter Choice: ");
scanf("%d", &a);
if (a == 1) {
strcpy(place, "England Tour");
amount = 28880;
}
else if (a == 2) {
strcpy(place, "Thailand Tour");
amount = 15500;
}
else if (a == 3) {
strcpy(place, "New York Tour");
amount = 567800;
}
else
printf("Enter Correct Choice...");
}
// Function To Take Passenger Details
void details()
{
int i, a;
char val[20], gen[6];
// Clearing Screen
system("cls");
// Calling heading() function
heading();
printf("\t\t\t\tEnter Number Of "
"Passengers: ");
scanf("%d", &k);
printf("\t\t\t\tEnter Date "
"(DD/MM/YY): ");
fflush(stdin);
gets(date);
for (i = 1; i <= k; i++) {
system("cls");
heading();
printf("\t\t\t\tEnter The %dth "
"Passenger Name: ",
i);
fflush(stdin);
gets(val);
printf("\t\t\t\tEnter The %dth "
"Passenger Gender: ",
i);
fflush(stdin);
gets(gen);
printf("\t\t\t\tEnter The %dth "
"Passenger Age: ",
i);
fflush(stdin);
scanf("%d", &a);
// Calling add_node() function
add_node(val, gen, a);
}
}
// Function to add details in
// node for each passengers
void add_node(char lol[20],
char der[6], int b)
{
Node *newptr = NULL, *ptr;
newptr = (Node*)malloc(sizeof(Node));
strcpy(newptr->name, lol);
strcpy(newptr->gen, der);
newptr->age = b;
newptr->link = NULL;
if (start == NULL)
start = newptr;
else {
ptr = start;
while (ptr->link != NULL)
ptr = ptr->link;
ptr->link = newptr;
}
}
// Function For Printing Receipt
void receipt()
{
int i, b;
Node* ptr = start;
system("cls");
heading();
printf("\n\t\t\t\t**Take Screenshot "
"For Further Use**\n");
for (i = 1; i <= k; i++) {
printf("\t\t\t\t%dst Passenger "
"Name: ",
i);
puts(ptr->name);
printf("\t\t\t\t%dst Passenger "
"Gender: ",
i);
puts(ptr->gen);
printf("\t\t\t\t%dst Passenger "
"Age: %d\n\n",
i, ptr->age);
ptr = ptr->link;
}
printf("\t\t\t\tSelected Type: ");
puts(type);
printf("\t\t\t\tPackage: ");
puts(place);
printf("\t\t\t\tDate: ");
puts(date);
b = amount * k;
printf("\t\t\t\tTotal Amount: %d", b);
printf("\n\t\t\t\t**Thank You For "
"registration**");
}
// Function For Printing Heading
// Of Portal
void heading()
{
printf("\t\t\t\t***Tourism Package "
"Management System***\n");
printf("\t\t\t***Vaccination Certificate "
"Is Necessary For Travel Purpose***\n\n");
}