TCS CPA PYTHON SBQ 13TH FEB 2022 QUESTION AND ANSWER

HELLO DORAEMONS,

IN THIS BLOGPOST ,I HAVE SHARED THE RECENTLY ASKED PYTHON QUESTION AND SOLUTION WHICH IS CERTAINLY USEFUL WHEN YOU WANT TO PRACTICE.HOPE THIS BLOG IS USEFUL TO YOU.

 Write the code to define a class to create Banquet Hall objects with below attributes:

1. A unique Hallid 

2. Name of the hall 

3. Capacity 

4. Price list - representing the price per plate as per guest

count maintained as a list of tuples (price per plate, lower limit of guests, upper limit of guests) 

5. Amenities list - represents the list of amenities available in the hall.


Write the code to define the method which takes parameters in above sequence and sets the values for attributes while creating a Banquet Hall object.


Wite the code to define a class to create objects of type Hall Management System with attribute as below : 

1. A list of Banquet Hall Objects.

Write the code to define the method which takes parameters in above sequence and sets the values for attributes while creating a Hall Management System object.

Define another method in this class for the following 

1. To calculate the bill for booking a Banquet Hall.

This method will take as input the count of guests and list

This method will take as input the count of guests and list of amenities required in the hall to be booked. Method will find from the list of Banquet Halls in the Hall Management System a Banquet Hall which can accommodate the given count of guests and can provide the list of amenities required. If a hall satisfying the required criteria can be found in the list of Banquet Halls of the Hall Management System, the price per plate as per the given count of guests is fetched from the price list. Finally, the bill is calculated as below and returned.

First the initial bill is calculated as: bill = (count of guests * price per plate)

Next the final bill is calculated including 13% GST on the bill calculated above.

If a Banquet Hall satisfying the required criteria (requested count of guests and requested amenities) is not found, method returns None.

Note:

̢ۢ While searching for the hall in the list of Banquet Halls of the Hall Management System the first best fit found will be considered. ̢ۢ String comparisons should be case insensitive

Instructions to write main section of the code a. You would require to write the main section completely, hence please follow the below instructions for the same. 

b. You would require to write the main program which is inline to the "sample input description section

mentioned below and to read the data in the same

sequence 

c.Create the respective objects Banquet Hall and Hall Management System with the given sequence of arguments to fulfill the method requirement defined in the respective classes while creating objects referring to the below instructions: 

1. Create a List of Banquet Hall Objects by reading values as below:

a. Read the count of Banquet Hall objects to be created supposex. 

b. Read values for hallid, name of the hall and capacity.

 c. Read a value representing count of elements to be added in price list, suppose n. 

d. Read values for price per plate, lower limit of guests,

upper limit of guests and store the data in the price listin required format. Repeat this step for n number of times 

e Read a value representing count of amenities to be stored in the amenities list, suppose m. 

f. Read value for an amenity and add to the amenities list Repeat this step for m number of times.

g. Create a Banquet Hall object with the values read for id name, capacity ( in point #c.i.b) and the lists created-pite list (created in points #c.i. and #c.i.d) and amenities list (created in points #cle and #c.i.f). Add the Banquet Hall

object to the list of Banquet Hall objects. h. Repeat steps b to g for x number of times.


Create a Hall Management System object by passing the List of Banquet Hall objects created in above point #

c. as the argument. 

d. Take a number value as input for the count of guests to be provided as argument to the second method (bill calculation method) defined in the Hall Management Klass.

e. Create a list of required amenities to be passed as argument to the second method (bill calculation method) defined in the Hall Management class To create the list - read a number for count of amenities to be added to the list suppose x, followed by that readx number of values for amenities and add to the list. fi Call the method defined in the Hall Management Class

to calculate the bill for booking a Banquet Hall from the main section by passing the value read in point #d and the list created in point #eas arguments. g. Display the calculated bill value returned by the method. You may refer to the sample output for the display format. If None is returned by the method then display the message "Hall Not Found "


Note: You need to press "Final Submit" for your program to be considered for evaluation. The program will not be

 display the message "Hall Not Found." (excluding the quotes).


You can refer to the below given sample inputs and outputs to have better clarity on input and output formats.



Sample input 1:

3

111 

Pernil Palace 

1000

3

200 

701 

1000 

300 

501 

700 

500

1

500

tables-chairs 

coat-room 

car-parking

122

Zakia's Palace

2000

3

500

1501

2000

700

1001

1500

1200

1

1000

5

tables-chairs

Stage

car parking

kitchen facilities

air-conditioners

113

Golden Garden

1000

3

200

701

1000

300

501

700

500

1

500

3

table_chairs

air-conditioners

car-parking

6000

4

tables-chairs

stage

car-parking

air-conditioners


output:

hallnot found


HOPE THIS BLOG IS HELPFUL, FOLLOW MY BLOG FOR MORE SIMILAR QUESTION. IF YOU HAVE ANY DOUBTS , FEEL FREE TO COMMENT IT DOWN.



2 Comentarios

Follow Me On Instagram