This is a project built in C++, generates an 'IPL 2021 Ticket .txt' file which contains the user data like the Name of the user, and Teams playing in that match, the timing of the match.
This code uses #include, #include, #include, #include, #include libraries.
I have globally declared the variables for storing teams and venues. This program uses mainly conditional statements and file handling techniques in the program.
I have written some other functions other than the main function.
1. setcolorandbackground(): This is used to set the colour and background of the text on the output console.
2. title(): This prints the title of the program 'IPL Ticket Booking' on the top of the console.
3. print_mainmenu(): This function prints the contents of the main menu on the screen.
4. print_teams(): This function prints the teams that will be participating in IPL.
5. print_venue(): This function prints the venues that IPL will be taking place.
6. print_matches(): This is used to print all the matches that will be taking place in IPL.
7. print_ticket(): This generates a text file i.e., 'IPL 2021 Ticket.txt' which has the user name and the details of the match.
The program executes in the following steps:
1. It asks the user, to enter his/her name.
2. Then, it displays the main menu.
3. By selecting the first choice, it prints the teams playing in IPL by using the function print_teams().
4. By selecting the second choice, it prints the venues that IPL will be taking place by using the function print_venue().
5. By selecting the third choice, it prints all the matches that will be played in the IPL i.e., a total of 56 matches and it asks if you want to book tickets and if so, it asks to enter the match number and a ticket is generated as an 'IPL 2021 Ticket'.txt file in the same folder as this .cpp file.
Submitted by Akshay Sai Reddy Kondu (akshaysrkondu)
Download packets of source code on Coders Packet