Text-based program for storing data on hotel room bookings

Assignment Help Other Subject
Reference no: EM132374419

Comparative Programming Languages Assignment - Parallel Implementations

This assignment will test your skills in programming applications to specification in a number of different programming languages.

Assignment Overview - You are tasked with creating a text-based program for storing data on Hotel Room Bookings - however, as this is a comparative languages course, you will be creating the same application in the following three programming languages:

  • Java,
  • Python, and
  • Lisp

As you implement the application in each language you should keep notes on:

  • The features of the languages used,
  • Which features you found useful, and
  • Any issues or complications which arose due to the complexity or lack of any language features.

A brief discussion document based on these programming features for each individual language accompanying each implementation is required. Finally, a comparative overview of the languages highlighting how they were suitable or not suitable for the creating this type of application is also required.

It is recommended that the first version of the application you write is in the programming language which is most familiar to you. This will help you to have a working 'template' for storing room bookings which you can then translate into the other programming languages.

Program Specification - When the program first launches, there is a menu which allows the user to select one of the following five options:

1) Add a guest

2) Add a room

3) Add a booking

4) View bookings

5) Quit

The functionality of these options is as follows:

1) When users add a guest they provide a name which is stored in some manner of array or list. Guests are assigned a unique ID value where the first guest added is assigned the ID value 1, the second guest added is assigned the ID value 2 and so on.

2) When users add a room they provide a room number and a room capacity (i.e. how many people can stay in the room at any one time) which is stored in some manner of array or list. Rooms have a property which indicates if they are booked or not for any given date - please see the Room Booking Dates section below for some guidance on the easiest way to implement this.

3) When users add a booking they provide a guest ID, room number, the number of guests staying and finally a check-in date and check-out date.

To successfully create a room booking:

  • The guest ID must be a guest which is registered on the system,
  • The room number must be of a room that exists,
  • The room must be able to accommodate the number of people in the booking (i.e. if the room capacity is for 2 people and the booking has 4 people staying then the booking must be refused), and finally
  • The room must be available on the dates requested.

4) When users views bookings they have the option to:

a. View guest bookings, or

b. View room bookings.

If the user opts to show guest bookings then they are prompted to enter the guest ID - and then any bookings made by that guest are displayed including:

  • The guest's name,
  • Which room number they booked & number of guests staying, and
  • The check-in and check-out dates.

If the user opts to show room bookings then they are prompted to enter a room number - and then any bookings for that room within the current year are displayed, including:

  • The guest's name,
  • The number of guests staying, and
  • The check-in and check-out dates.

5) When a user chooses to Quit the program terminates with a goodbye message.

Each implementation of your project (in each of the three languages you choose) should aim to closely match the setup and structure of the program as shown in the example output on the following pages.

You may wish create separate Guest, Room and potentially Booking classes as part of your implementations, but you do not have to.

You may also wish to add code to pre-create a number of guests, rooms and bookings on each run of your code to avoid the need to type in these details over and over when testing your program. If you do so, please comment out these pre-defined entries before submitting your assignment.

Room Booking Dates

Dates can be a complex subject to do correctly in programming because we often want to calculate how many days are between dates, and there are issues like date formats (dd/mm/yy? mm/dd/yyyy?) to consider as well as leap years where February has 29 days instead of the usual 28 and so on.

Some programming languages come with built-in classes to work with dates - and you may use them if you wish. In fact, you are encouraged to use them as they are precisely what you would use when working in the real world, so experience in them now will increase your programming knowledge!

However, to keep things simple, our room booking system will only allow bookings within the current year, and the easiest way to do that is to store dates as the number of the day between 1 and 365. So, day 18 would be the 18th of January (which has 31 days), day 32 would be the 1st of February, and so on.

As such, one way to keep track of whether a room is booked or not for a current day would be for each room to have an array of 365 boolean values which are all set to false (i.e. room is not booked for that particular day) when the room is first created.

Then, because users don't like entering dates as values between 1 and 365, we could have four utility methods:

- int dateToDayNumber(int month, int day),

- int dayNumberToMonth(int dayNumber),

- int dayNumberToDayOfMonth(int dayNumber), and

- bool setBooked(int startDayNumber, int endDayNumber).

Example code for the first tree of these methods, written in a Java-like syntax, is provided on the following page - you should write the setBooked method yourself. The above setBooked method signature assumes you are running the method on a Room object - if you are not, then you will also have to pass in the room number so you know which room's booked array to modify!

The setBooked method should check if the room is booked for each day between the start and end dates (inclusive) to ensure the room is available. If the room is not available on a day the method returns false, but if the room is available between the start and end dates then it should be set to booked for each day requested and the method should return true to indicate success.

Bookings are not required to have booking ID values assigned to them, but you may add them if you wish as they may be useful to later functionality.

Attachment:- Comparative Programming Languages Assignment File.rar

Reference no: EM132374419

Questions Cloud

How were their biorhythms in their last tennis match : ITECH1400 Foundations of Programming-Federation University-Australia-How were their Biorhythms in their last tennis match? Did they win?
Propose a training program to foster an environment : Each culture has nuances related to workforce development (career) and training (specific skills), which can create challenges, opportunities, and pitfalls.
Assess derivatives and derivative securities : Identify the positives and negatives of derivatives and how could employ derivatives? Provide examples of derivatives in real-world situations and their impact.
Organization risk of having information : Bananafarm Corporation stores all of its sensitive information online through data encrypted technology designed to provide security against third-party hackers
Text-based program for storing data on hotel room bookings : Implementation of your project (in each of the three languages you choose) should aim to closely match the setup and structure of the program
Growth strategy for the charity : Consider the organizational strategies listed here. Which of the following would be a growth strategy for the charity?
Describe your training plan and approach to the training : In a 1,000- word Infographic, describe your training plan and approach to the training. Be sure to consider how the ACA impacts the following.
Trade relationship between china and the united states : In the trade relationship between China and the United States, what type of role does the American company play?
Discussions and management of supply chain operations : The Supply Chain Council was formed to standardize the discussions and management of supply chain operations.

Reviews

Write a Review

Other Subject Questions & Answers

  What are place in community that offer mental health service

What are some places in your community that offer mental health services? Would you feel comfortable seeking assistance at one of these facilities? Why or why not? 100 words

  Explain the reasons you would or would not delegate the task

Write a memo to identify and describe in which of these scenarios you would delegate and in which you would not.

  Define strategies to promote literacy development

Compose a 150-250 word executive summary introducing ELL families to the purpose of the resource list for families with ELL children.

  Explore the circumstances coupons would be an inducement

Assume you are the marketing director of a new restaurant that plans to open in six months. In what circumstances coupons would be an inducement for repeat business and when they would not.

  What was the terrorist act and was it an individual or group

What was the terrorist act? Was it an individual or group? Would the terrorist(s) be classified as a criminal, crusader or crazy?

  Define the definition of the word development means

What do you think the definition of the word "development" means and why What is the connotation of the word

  Workers'' compensation is an exclusive remedy

"Workers' compensation is an exclusive remedy." Elaborate on this statement with the help of an example.

  Analyze and explain the elements of todays police structure

Analyze and explain the elements of today's police structure and functions that were influenced by the military.

  Explain who you will involve in the assessment of martin

SOCIAL WORK ADMISSIONS 2017/18 - WRITTEN TEST. As the Social Worker, explain who you will involve in the assessment of Martin and why you will involve them. Briefly outline the information that you will seek and how you will use this in the assessmen..

  Write response about american nurses association

Across the country, every state has several organizations that represents and advocate for nurses, the American Nurses Association (ANA) being one of the.

  Distinction between implicit and explicit memories

The distinction between implicit (nondeclarative) and explicit (declarative) memories is that:

  Explain the patient protection and affordable care act

Explain the Patient Protection and Affordable Care Act? Why did CMS become more involved in the reimbursement component of health care?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd