filmov
tv
Static List Level 3|Assignment Set-3|Object Oriented Programming Using Python|NM|Infosys

Показать описание
#naanmudhalvan #infosys #springboard
#answers
#objectorientedprogrammingusingpython
#answersdotcom
#staticlistlevel3
Assignment on Static List - Level 3
Problem Statement
"FairyLand Multiplex" wants to automate ticket booking and seat allocation process.
Write a python program to implement the class diagram given below.
Assumptions:
Multiplex has two screens having different seating capacity
Two movies will be screened everyday (one show/movie)
Booking will be opened every day morning for that day’s shows
Movie name, total tickets available, ticket price and last seat number allocated for both movies are stored in lists having one to one correspondence. Details of first movie will be available at the 0th index and second movie at the 1st index of these lists
Method description:
check_seat_availability(movie_index,number_of_tickets): Checks seat availability for the given movie. Refer the code given in starter code
calculate_ticket_price(movie_index,number_of_tickets): Calculates total ticket price for the given movie. Refer the code given in starter code
generate_seat_number(movie_index,number_of_tickets): Allocate required number of seats for the given movie.
Seat numbers should be auto-generated as mentioned below:
Seat numbers should be generated starting from 1, prefixed by "M1-" for movie-1 and "M2-" for movie 2
Examples movie-1: M1-1, M1-2, M1-3 etc, movie-2: M2-1,M2-2 etc
Update total number of tickets available for the given movie in list_total_tickets
Update last seat number allocated for the given movie in list_last_seat_number
Return the list of generated seat numbers
book_ticket(movie_name,number_of_tickets): Book tickets for the given movie.
Return 0, if movie name is invalid
Return -1, if enough tickets are not available for the given movie
Else,
Generate seat numbers
Initialize attribute, seat_numbers with the list of generated seat numbers
Calculate total ticket price
Perform case sensitive string comparison.
#answers
#objectorientedprogrammingusingpython
#answersdotcom
#staticlistlevel3
Assignment on Static List - Level 3
Problem Statement
"FairyLand Multiplex" wants to automate ticket booking and seat allocation process.
Write a python program to implement the class diagram given below.
Assumptions:
Multiplex has two screens having different seating capacity
Two movies will be screened everyday (one show/movie)
Booking will be opened every day morning for that day’s shows
Movie name, total tickets available, ticket price and last seat number allocated for both movies are stored in lists having one to one correspondence. Details of first movie will be available at the 0th index and second movie at the 1st index of these lists
Method description:
check_seat_availability(movie_index,number_of_tickets): Checks seat availability for the given movie. Refer the code given in starter code
calculate_ticket_price(movie_index,number_of_tickets): Calculates total ticket price for the given movie. Refer the code given in starter code
generate_seat_number(movie_index,number_of_tickets): Allocate required number of seats for the given movie.
Seat numbers should be auto-generated as mentioned below:
Seat numbers should be generated starting from 1, prefixed by "M1-" for movie-1 and "M2-" for movie 2
Examples movie-1: M1-1, M1-2, M1-3 etc, movie-2: M2-1,M2-2 etc
Update total number of tickets available for the given movie in list_total_tickets
Update last seat number allocated for the given movie in list_last_seat_number
Return the list of generated seat numbers
book_ticket(movie_name,number_of_tickets): Book tickets for the given movie.
Return 0, if movie name is invalid
Return -1, if enough tickets are not available for the given movie
Else,
Generate seat numbers
Initialize attribute, seat_numbers with the list of generated seat numbers
Calculate total ticket price
Perform case sensitive string comparison.
Комментарии