Given the data for Hotel management and User:
Hotel Name Room Available Location Rating Price per Room H1 4 Bangalore 5 100 H2 5 Bangalore 5 200 H3 6 Mumbai 3 100
User Name UserID Booking Cost U1 2 1000 U2 3 1200 U3 4 1100
The task is to answer the following question.
- Print the hotel data.
- Sort hotels by Name.
- Sort Hotel by highest rating.
- Print Hotel data for Bangalore Location.
- Sort hotels by maximum number of rooms Available.
- Print user Booking data.
Machine coding round involves solving a design problem in a matter of a couple of hours.
It requires designing and coding a clean, modular and extensible solution based on a specific set of requirements.
- Create classes for Hotel data and User data.
- Initialize variables that stores Hotel data and User data.
- Create Objects for Hotel and user classes that access the Hotel data and User data.
- initialize two vector array that holds the hotel data and and user data.
- solve the Above questions one by one.
Below is the implementation of the above approach.
PRINT HOTELS DATA: HotelName Room Avalable Location Rating PricePer Room: H1 4 Bangalore 5 100 H2 5 Bangalore 5 200 H3 6 Mumbai 3 100 SORT BY NAME: H3 6 Mumbai 3 100 H2 5 Bangalore 5 200 H1 4 Bangalore 5 100 SORT BY A RATING: H1 4 Bangalore 5 100 H2 5 Bangalore 5 200 H3 6 Mumbai 3 100 HOTELS FOR Bangalore LOCATION IS: H1 4 Bangalore 5 100 H2 5 Bangalore 5 200 SORT BY ROOM AVAILABLE: H3 6 Mumbai 3 100 H2 5 Bangalore 5 200 H1 4 Bangalore 5 100 PRINT USER BOOKING DATA: UserName UserID HotelName BookingCost U1 2 H1 1000 U2 3 H2 1200 U3 4 H3 1100
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program for Employee Management System
- GUI Application for the Student Management System
- Student Information Management System
- Project Idea | Smart Waste Management System
- Menu-Driven Program for Bank Management System
- Student Data Management in C++
- Perl | Database management using DBI
- First Fit algorithm in Memory Management using Linked List
- Project Idea | Smart Waste Management Systems
- Program for Best Fit algorithm in Memory Management using Linked List
- Banker's Algorithm in Operating System
- Project Idea | Ward Tracking System
- Voting System Project Using Django Framework
- Project Idea | Distributed Downloading System
- Project Idea | Bus Notification System Using Crowdsourcing
- Menu driven program for system control using C++
- Project Idea | Attendance System Using Smart Card
- Project Idea | (A.T.L.A.S: App Time Limit Alerting System)
- Project Idea | Road Accident Safety System
- Pizza Shop Billing System using Java Swing
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.