New! Hire Essay Assignment Writer Online and Get Flat 20% Discount!!Order Now

ITECH1000 Programming

Published : 26-Aug,2021  |  Views : 10

Question:

2) Write an algorithm that describes how the program will operate.
a. All program requirements must be included, even if you do not end up including all these requirements in your program code.
b. The algorithm must be structured logically so that the program would function correctly.
3) Prepare and document test cases that can be used to check that the program works correctly,once it has been coded. You do NOT need to actually run the test cases in this stage; this will occur in Stage 3: Testing.
a. All program requirements must be included, even if you do not end up including all these requirements in your program code.
b. Make sure the test cases include checking of data entered by the user to make sure that only valid data is accepted. If the user enters invalid data, the user should be informed of this and given another chance to enter the data. NB: As we have not covered exception handling, you may assume that the user will always enter the expected data type.
c. Test cases should be documented using a template like the one below. You may include extra information if you wish. At this stage, the Actual Result column will be left blank.

Answer:

This JAVA assignment focus on one program which is HOTEL RECOMMENDATION SYSTEM. As the name suggests, it show the user a list of recommended hotel according to his needed occupancy, budget and hotel star rating. It also shows user the details of all the hotels like star rating, occupancies, vacancies, daily price, sale price etc.

Variables in the Program

  • hotelName :- This variable is used to store the name of the hotel. It is of the string type.
  • Address: - This variable is used to store the address of the hotel. It is of string data type.
  • starRating:- This variable is used to store the star rating of hotel. It is of integer type.
  • roomTypes:- This variable is used to store the type of the room. It is of integer data type.
  • roomsList:- This variable is used to store the list of the room.This is of array data type.
  • roomName:-roomName  is of string data type. It is used to store the name of the room.
  • regularPrice:-regularPrice  is of integer data type. It is used to store the price of the room.
  • salePrice:-sale price is of integer data type. It is used to store the sale price of the room.
  • maxOccupancy:- maxOccupany is of integer data type. It is used to store the maximum occupancy of the room in the hotel.
  • numberOfRooms:-numberOfRooms is of integer data type. It is used to store the number of the room available in the hotel.
  • numbeOfVacancies:-numberOfVacancies is of integer data type. It is used to store the number of vacancies.
  • flag:- This variable is used to store the data which of integer data type. It indicates the choice of the user.
  • Hotels[] l_hotel:-This variable store the list of the hotel.This variable is of array type

Methods in Program

  • public Hotels():- This is the default constructor which is used to give 0 values to the data.
  • public Rooms[] getRoomsList():- This method returns the room list of the hotel.
  • public void setRoomsList(Rooms[] roomsList):- This method is used to set the room list.
  • public String getAddress():- This method is used to get the address of the hotel.
  • public String getHotelName():- This method is used to get the hotel name.
  • public int getRoomTypes():- This method is used to get the room type.
  • public int getStarRating():- This method is used to get the star rating of the hotel.
  • public void setAddress(String Address):- This method is used to set the address of the hotel.
  • public void setHotelName(String hotelName):- This method is used to set the hotel name.
  • public void setRoomTypes(int roomTypes):- This method is used to set the room type.
  • public void setStarRating(int starRating):- This method is used to set the star rating.
  • public String toString():- This method is used to show the details of the hotels.
  • public Rooms():-Default constructor which is used to give 0 values to the data variable.
  • public int getMaxOccupancy():-This is used to get the maximum occupancy of the room.
  • public int getNumberOfRooms():-This is used to get the number of rooms in the hotel.
  • public int getNumberOfVacancies():-This is used to get the number of vacancies.
  • public int getRegularPrice():-This  is used to get the regular price of the room in a particular hotel.
  • public String getRoomName():-This is used to get the room name.
  • public int getSalePrice():-This is used to get the sale price of the room.
  • public void setMaxOccupancy(int maxOccupancy):-This is used to set the maximum occupancy of the room.
  • public void setNumberOfRooms(int numberOfRooms):-This is used to set the number of rooms.
  • public void setNumberOfVacancies(int numberOfVacancies):-This is used to set the number of vacancies.
  • public void setRegularPrice(int regularPrice):- This  is used to set the regular price.
  • public void setRoomName(String roomName):- This is used to set the room name.
  • public void setSalePrice(int salePrice):- This is used to set the sale price of the room.
  • public String toString():- This is used to display the details of the room.
  • public START():-This is the default constructor which is used to initialize array list with some value.
  • public void begin():- This method is used to initialize array of rooms and hotels with some values like name, address etc.
  • public void details():- This method is used to display all the details of hotel and room to the user.
  • public void findcheap():- This method is used to find the cheapest hotel available.
  • public void setprice():- This method is used to set the price of the hotel rooms.
  • public void findrooms():- This method is used to find the room with the help of the details entered by the user.

Process in Void Main

Series of the steps followed in the void main are as follows:-

  1. Creating the object of the START class.
  2. Creating the scanner variable so that user can give input.
  3. Initialization of the flag variable.
  4. Display of the welcome message to the screen.
  5. Display of the Developer details to the screen.
  6. Initialization of the do-while loop.
  7. Displaying the list of the options available for user.
  8. Starting of the switch case for cases starts from 1-5 with default case.
  9. End of do-while loop with the program.

Get An Awesome Price Quote For Your Paper – Absolutely FREE!

250 Words

Estimated Price* $7.1 $8.9

offer
20% OFF

Get $20 just by submitting the completed form

*Prices may vary as per change in requirements

Our Amazing Features

delivery

No missing deadline risk

No matter how close the deadline is, you will find quick solutions for your urgent assignments.

work

100% Plagiarism-free content

All assessments are written by experts based on research and credible sources. It also quality-approved by editors and proofreaders.

time

500+ subject matter experts

Our team consists of writers and PhD scholars with profound knowledge in their subject of study and deliver A+ quality solution.

subject

Covers all subjects

We offer academic help services for a wide array of subjects.

price

Pocket-friendly rate

We care about our students and guarantee the best price in the market to help them avail top academic services that fit any budget.

Getting started with EssayAssignmentHelp is FREE

15,000+ happy customers and counting!

Rated 4.7/5 based on
1491 reviews