Create program for hotel room bookings in java and python

Assignment Help Programming Languages
Reference no: EM132420865

ITECH5403 - Comparative Programming Languages - Federation University

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.

Additional Documentation - Language Suitability Report

Every programming language is designed to be used for different types of tasks, and has features which allow it to be a good choice for those tasks, while perhaps not as good at different types of tasks.

During your implementation of the program in each of the languages chosen you should make notes about the language features which exist or do not exist, and which have therefore made program development easier or more difficult.

Where a language has not provided a feature which would have been useful to the implementation of the program, or where the complexity of using a language feature has been high you should remark upon it and briefly discuss a mechanism or feature of another language which would have made development easier.

After completing the application in all languages (or as many as you can), discuss the comparative ease of implementation in terms of the design, implementation and debugging for each programming language, including how robustness issues were addressed.

Attachment:- Comparative Programming Languages Assignment File.rar

Reference no: EM132420865

Questions Cloud

Summarize the key elements of crime control policy : Summarize the key elements of the selected crime control policy. Explain the political process that sets the foundation for the selected crime control policy.
Prepare the journal entry for the payment of the note : Prepare the journal entry for the payment of the note on December 30,2018
Determine the amount of cash larkspur received : Determine the amount of cash Larkspur received from the loan on December 31, 2020. (Round present value factors to 5 decimal places, e.g. 0.52513
Describe the current financial environment in healthcare : Describe the current financial environment in healthcare and its influence on decision making.
Create program for hotel room bookings in java and python : Create program for Hotel Room Bookings in Java and Python - Creating the same application in the three programming languages
Identify a study that will be used as a model study : For this discussion, you will identify a study that will be used as a model study throughout the course. It is permissible to use the study that you described.
Net income and ending balance of retained earnings : a) Calculate net income and the ending balance of retained earnings at December 31, 2018.
BUSN11080 Managing Organisational Health Assignment : BUSN11080 Managing Organisational Health Assignment Help and Solution, University of the West of Scotland, UK. Topic - Organisational Performance Management
Examine elements necessary to commit crime of shoplifting : In this question, you will examine the elements necessary to commit the crime of shoplifting. Donna is shopping with her five-year-old daughter, Haley.

Reviews

Write a Review

Programming Languages Questions & Answers

  Program that creates a series of random 2d objects

Create a program (OpenGL, or DirectX) that creates a series of random 2D objects, (or 3D objects that only move in 2D), about 25 is probably good but you may need more or less and has them move around on the screen, they should wrap around the edg..

  Write a program which validates that the entry is a integer

Write a program which: Asks the user to enter a positive integer greater than or equal to 0, Validates that the entry is a positive integer and Outputs the digits in reverse order with a space separating the digits.

  User-s ability to navigate the web site correctly

This can paralyze a user's ability to navigate the Web site correctly. Examples include opening new browser windows or using meta-refresh to force a page.

  Program instantiates four dates and allots invalid values

Demonstration program instantiates four Dates and purposely allots invalid values to some of arguments; class methods will correct invalid values.

  Write program that creates a dictionary containing us states

Write a program that creates a dictionary containing the U.S. states as keys and their capitals as values. The program should keep a count of the number.

  Create application that uses two-dimensional arrays

Create the application that uses 2-dimensional arrays to keep track of 5 students' grades, with each student having 3 different classes. You require to ask user to enter grade for each of 5 students.

  Application development and programming languages

Application Development and Programming Languages,  Programming languages have evolved since the First Generation Languages (1GLs) in the 1940s. The 1GLs were machine languages, which interacted directly with hardware. 2GLs were assembly languages. F..

  Create test application that creates objects of type book

Create a test application that creates several objects of type book class and adds each Book to an ArrayList. Your test application should then do the following.

  Project on internet of things vulnerability proxy scanner

Prepare a Project on Internet of Things Vulnerability Proxy Scanner - Must be completed with Scala programming language, play framework, Postgres, docker

  Write a program and store it in a file

Write a program, and store it in a file called String Funtions.xlsm, that does the following: It asks the user for a word with at least 10 characters and stores

  Html5 browsers will support the following new technology

HTML5 browsers will support the following new technology. o CSS 2 o PDF 10.2

  Write a function vowels that receives an array of characters

Write a function vowels that receives an array of characters an its size, it returns how many vowel letters in that array. The vowel letters are A, E, I, O, U.

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