Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Tourism Management System in

C/C++
Last Updated : 06 Sep, 2022

The Tourism Management System is implemented by C programming.


It is as same as one can see while going for online booking. Here, the
underlying idea is to present users with two choices International or
India Tour packages. Then according to the choice, the available
packages will be displayed. The next step is to mention the total
number of passengers and all the necessary details of the passengers.
The total amount will be evaluated and a receipt will be generated on
the screen.

Approach:

A structure is implemented for taking the details of the passengers


like name, gender, and age.
Six functions– void details(), void add_node(char, char, int), void
receipt(), void heading(), void inter(), void india() are created to
handle different functionality.
The heading() function is declared that will make the heading of the
portal.
The system(“cls”) is used to clear our screen.
Three elements are added in the structure like two strings one for
taking passenger name and gender, and one integer for taking
passenger age. Also, the structure pointer will be used that will help
to link the next node of another passenger. It is similar to a linked
list.
Some character arrays are defined and some integer arrays as
globally.
The user has to give choice for International or Indian Tour
packages.

If the user choose International tour packages then inter() function
will be called. Here, the user has to choose certain packages from a
list.
If the user choose the India tour package then india() function will be
called. Here, the user has to choose certain packages from a list.
The details() function will be called to take the number of
passengers.
A for loop will be executed to take details of each passenger. Then
the taken details will be sent to the add_node() function.
In the add_node function, every detail will store into a node for each
passenger. This node will link each other. This is based on the linked
list concept.
At last, the receipt() function will be called, which will display all the
necessary details.

Source Code: Below is the implementation of the above approach

// 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 75%
Courses upto i, Off
a;C C Basics C Data Types C Operators C Input and Output C Cont
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");
}

Output:

00:00 02:08

Never before seen offer on GeeksforGeeks Courses! Get up-to 75% off on all
premium courses such as Full Stack Web Dev, Backend Dev, DSA for
Interview and more. Avail discount now!

Summer-time is here and so is the time to skill-up! More than 5,000


learners have now completed their journey from basics of DSA to
advanced level development programs such as Full-Stack, Backend
Development, Data Science.

And why go anywhere else when our DSA to Development: Coding


Guide will help you master all this in a few months! Apply now to our
DSA to Development Program and our counsellors will connect with
you for further guidance & support.

soun… 11

Next Article
Railway Reservation System in C

Similar Reads

Program for Employee Management System


A Employee’s Management System (EMS) is a software built to handle
the primary housekeeping functions of a company. EMS help companie…
14 min read

Movie tickets Booking management system in Python


In this article, we are going to code a simple program for book movie
tickets. It will be very useful to the passionate beginners who wanted to…
5 min read

Employee Management System using doubly linked list in C


Design and implement a menu-driven program in C for the below
operations on DLL of employee data with fields: SSN, name, department…
6 min read

Health Management System using Python


Sometimes we are so busy that we are not even able to care for our body
and by caring we mean fitness, food, exercises and much more, and the…
7 min read
Examination Management System in C
Problem Statement: Write C program to build a Software for Examination
Management System that can perform the following operations:…
9 min read

View More Articles

Article Tags : school-programming C Programs

A-143, 9th Floor, Sovereign Corporate


Tower, Sector-136, Noida, Uttar Pradesh
- 201305

Company Explore
About Us Job-A-Thon Hiring Challenge
Legal Hack-A-Thon
Careers GfG Weekly Contest
In Media Offline Classes (Delhi/NCR)
Contact Us DSA in JAVA/C++
Advertise with us Master System Design
GFG Corporate Solution Master CP
Placement Training Program GeeksforGeeks Videos
Geeks Community

Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL DSA Interview Questions
R Language Competitive Programming
Android Tutorial
Data Science & ML Web Technologies
Data Science With Python HTML
Data Science For Beginner CSS
Machine Learning Tutorial JavaScript
ML Maths TypeScript
Data Visualisation Tutorial ReactJS
Pandas Tutorial NextJS
NumPy Tutorial NodeJs
NLP Tutorial Bootstrap
Deep Learning Tutorial Tailwind CSS

Python Tutorial Computer Science


Python Programming Examples GATE CS Notes
Django Tutorial Operating Systems
Python Projects Computer Network
Python Tkinter Database Management System
Web Scraping Software Engineering
OpenCV Tutorial Digital Logic Design
Python Interview Question Engineering Maths

DevOps System Design


Git High Level Design
AWS Low Level Design
Docker UML Diagrams
Kubernetes Interview Guide
Azure Design Patterns
GCP OOAD
DevOps Roadmap System Design Bootcamp
Interview Questions

School Subjects Commerce


Mathematics Accountancy
Physics Business Studies
Chemistry Economics
Biology Management
Social Science HR Management
English Grammar Finance
Income Tax

Databases Preparation Corner


SQL Company-Wise Recruitment Process
MYSQL Resume Templates
PostgreSQL Aptitude Preparation
PL/SQL Puzzles
MongoDB Company-Wise Preparation
Companies
Colleges
Competitive Exams More Tutorials
JEE Advanced Software Development
UGC NET Software Testing
UPSC Product Management
SSC CGL Project Management
SBI PO Linux
SBI Clerk Excel
IBPS PO All Cheat Sheets
IBPS Clerk

Free Online Tools Write & Earn


Typing Test Write an Article
Image Editor Improve an Article
Code Formatters Pick Topics to Write
Code Converters Share your Experiences
Currency Converter Internships
Random Number Generator
Random Password Generator

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

You might also like