Dr. A.P.J. Abdul Kalam Technical University (AKTU), Lucknow

Lab Exercise

35. Define a structure that can describe a hotel. It should have the member that includes the name, address, grade, room charge, and number of rooms. Write a function to print out the hotel of the given grade in order of room charges.

Sample Input and Output

Stdin Inputs:

2 1 A Hotel Obrai
Delhi
57 13500 1 A Hotel Chanda
Ghaziabad
37 12000 3 1 3

Sample Result:

***Menu***
1. List hotels
2. Edit hotels
3. Exit
Choice: 2

***Hotel Edit Menu***
1. Add Hotel
2. Delete Hotel
3. Exit Hotel Edit Menu
Choice: 1

Add Hotel
Input Grade: A
Input Name: Hotel Obrai
Input Address: Delhi
Input Number of Rooms: 57
Input Rent: Rs. 13500
Hotel Obrai added successfully.

***Hotel Edit Menu***
1. Add Hotel
2. Delete Hotel
3. Exit Hotel Edit Menu
Choice: 1

Add Hotel
Input Grade: A
Input Name: Hotal Chanda
Input Address: Ghaziabaad
Input Number of Rooms: 37
Input Rent: Rs. 12000
Hotel Chanda added successfully.

***Hotel Edit Menu***
1. Add Hotel
2. Delete Hotel
3. Exit Hotel Edit Menu
Choice: 3

***Menu***
1. List hotels
2. Edit hotels
3. Exit
Choice: 1

Hotel Grade: A
List of hotels of grade A

1. Hotal Chanda
Ghaziabaad
No of Rooms: 37
Rent: Rs. 12000.00

2. Hotel Obrai
Delhi
No of Rooms: 57
Rent: Rs. 13500.00

Total 2 hotel found.

***Menu***
1. List hotels
2. Edit hotels
3. Exit
Choice: 3

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top
Scroll to Top