Test Index
CBSE Class 12 Computer Science 2023 Paper Set 4
© examsnet.com
Question : 30 of 35
Marks:
+1,
-0
(a) A list contains following record of customer:
[Customer_name, Room Type]Write the following user defined functions to perform given operations on the stack named
'Hotel' :(i) Push_Cust() – To Push customers’ names of those customers who are staying in ‘Delux’ Room Type.(ii) Pop_Cust() – To Pop the names of customers from the stack and display them. Also, display “Underflow” when there are no customers in the stack.For example :If the lists with customer details are as follows :["Siddharth", "Delux"]["Rahul", "Standard"]["Jerry", "Delux"]The stack should contain
JerrySiddharthThe output should be:
JerrySiddharthUnderflowOR(b) Write a function in Python,
Push (Vehicle) where, Vehicle is a dictionary containing details of vehicles – {Car_Name: Maker}.The function should push the name of car manufactured by ‘TATA’ (including all the possible cases like Tata, TaTa, etc.) to the stack.For example:If the dictionary contains the following data:Vehicle={"Santro":"Hyundai","Nexon":"TATA","Safari":"Tata"}The stack should containSafariNexon
Go to Question: