PIC Microproject 1
PIC Microproject 1
PIC Microproject 1
Academic year
2023-2024
Certificate
This is to certify that Mr. Amaan Abrar Kazi Roll No. 58 of Second Semester of Diploma in
Computer Engineering of Institute, VES POLYTECHNIC (Code: 0004) has completed the Micro
Project satisfactorily in Subject Programming in C (312303) for the academic year 2023- 2024. as
Seal of
Institution
INDEX
Academic year: 2023-2024 Name of the faculty: Mr. Tejas Shah Program code: CO2K
Course & course code: PIC (312303) Name of the candidate: Amaan Kazi
1 AIM 1
3 Resource used 2
4 Action Plan 2
5 Actual Procedure 3
6 Code 4,5,6,7
7 Output 8,9
9 References 10
Annexure – I
Micro-Project Proposal
DESIGN MOVIE TICKET BOOKING
CO1 - Develop C program using input - output functions and arithmetic expressions.
CO2 - Develop C program involving branching and looping statements
CO3 - Implement Arrays and structures using C programs
CO4 - Develop C program using user-defined functions
CO5 - Write C program using pointer
2 Turbo C++
Define Movie Structure: The code begins by defining a structure Movie to hold
details about each movie, including its title, description, ratings and ticket price.
Initialize Movie Data: An array of movies is initialized with details of several movies.
Each movie has a title, description, ratings and ticket price.
Main Function: In the main function, The Load Menu function is called which then
calls the Load Movie function with the movie number as argument which shows more
details for that movie and then allows the user to buy tickets for that movie by calling
the Buy function
Load Menu: The load menu function prints out the available movies titles.
Load Movie: The load movie function displays all details about a movie after taking
the movie number as an argument based on the number in menu
Buy: The buy function is defined to handle the booking process for a selected movie.
It prompts the user to select number of seats and displays final price after which the
user can confirm or change no. of tickets to book
Input Validation: The code includes basic input validation to ensure that the user
enters valid choices for selecting movies and seats.
Exit Condition: The loop continues until the user chooses to exit by entering 0.
6.0 Code
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
// Movie Structure
struct movies {
char title[50];
char description[500];
float rating;
int ticketPrice;
} movie[5];
// Functions
void LoadMenu();
void LoadMovie(int n);
void BuyTicket(int n);
void main ()
{
clrscr();
LoadMenu();
printf("Press any key to exit");
getch();
}
void LoadMovie(int n)
{
clrscr();
int input;
n--;
printf("Title: %s \n", movie[n].title);
printf("Description: %s \n", movie[n].description);
printf("Rating: %.1f/5.0 \n", movie[n].rating);
printf("Ticket Price: Rs.%d \n", movie[n].ticketPrice);
input:
printf("\n0: Back \n1: Buy \n");
scanf("%d", &input);
if (input == 0)
{
LoadMenu();
}
else if (input == 1)
{
BuyTicket(n);
}
else
{
printf("Invalid, try again \n");
goto input;
}
}
void LoadMenu()
{
clrscr();
int i, num;
if (num == 0)
{
exit(0);
}
LoadMovie(num);
}
void BuyTicket(int n)
{
clrscr();
int tickets, input;
if (tickets < 1)
{
printf("Invalid, try again \n");
goto ticketNum;
}
if (input == 0)
{
LoadMovie(n);
}
else if (input == 1)
{
printf("\nSuccessfully Purchased %d Tickets for %s \n", tickets, movie[n].title);
printf("Press any key to continue \n");
getch();
LoadMenu();
}
else if (input == 2)
{
goto ticketNum;
}
}
7
7.0 Outputs of the Micro-Projects:-
8
9
8.0 Application of this Micro-Project
The above code serves as a foundational example for building a console-based movie ticket booking
system in C. Here's how the code can be applied in various contexts:
Local Movie Theaters: Small, independent movie theaters that don't have complex ticket booking
systems can use this code as a starting point to develop their own ticket booking software.
Educational Purposes: Students learning C programming can use this code as a project to understand
concepts like arrays, structures, loops, and user input/output handling.
Prototype Development: Software development teams working on larger movie ticket booking
applications can use this code as a prototype or proof-of-concept to demonstrate the basic functionality
before implementing more advanced features.
Learning Resource: Programming tutors or instructors can use this code as a teaching tool to illustrate
software development concepts and best practices in C programming.
Personal Projects: Hobbyists or enthusiasts interested in software development can use this code as
inspiration to build their own movie ticket booking system for personal use or as part of a portfolio project
9.0 References
www.geeksforgeeks.org,Chatgpt,google
10
Suggested Rubric for Assessment of Micro-Project
12
2 Literature review/
Information Collection
5 Quality of Prototype/Model
6 Report Preparation
7 Presentation(5m)
8 Defense/Viva(5m)
Roll No. Process and Product Individual Viva (5 Marks) Total Marks
Assessment (15 Presentation 25
Marks) (5 Marks)
58
14