Creating a text-based program for storing data

Assignment Help Programming Languages
Reference no: EM132366233

Parallel Implementations

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.

Reference no: EM132366233

Questions Cloud

Discuss statesmanship as it relates to financial management : Discuss statesmanship as it relates to financial management in the public administration context. Discuss the challenges that statesmen would face in this area.
Explain the differences between BI and Data Science : What are the three characteristics of Big Data, and what are the main considerations in processing Big Data? Explain the differences between BI and Data Science
How emotions influence learning and meaning : Emotions play a large part in the learning process. Emotions impact how we learn and the information that we are able to retain. Our brains are highly.
Explain the multiple learning styles for adults : As we've learned throughout the course, an educator's job is not simply to train students to recall facts and/or parrot ideas. An educator must create an.
Creating a text-based program for storing data : ITECH5403 - Parallel Implementations - Creating a text-based program for storing data on Hotel Room Bookings - however, as this is a comparative languages
What are the benefits of effective partnerships : While there are several different types of family involvement roles that you have explored, there is a common theme for all of them, in that each person.
Examine several different family and community partnerships : This week's discussion will allow you to examine several different family and community partnerships common in early childhood education. You will use your know
Summarize and reflect upon your chart and strategy : Using the "Fluency, Comprehension, and Vocabulary: I Do, We Do, You Do" chart, summarize and reflect upon your chart, strategy, and facilitation in 250-500 word
Detect david alleged industrial espionage : What steps might have been taken to detect David's alleged industrial espionage? What steps might have been taken to prevent his perpetrating such an offense?

Reviews

len2366233

9/5/2019 2:51:59 AM

Documentation and discussion of the comparative ease of implementation (design / implement / debug) in each programming language, including how robustness issues were addressed. 10 Spelling and grammar 5 Assignment mark total / 45 Contribution to unit mark (out of 20%) %

len2366233

9/5/2019 2:51:51 AM

Assignment 2 – Parallel Implementations Student Name: Student ID: Requirement Weight Mark Implementation 1: Java - Functionality, - Adherence to the specification, - Robustness / input handling. 10 Implementation 2: Python - Functionality, - Adherence to the specification, - Robustness / input handling. 10 Implementation 3: Lisp - Functionality, - Adherence to the specification, - Robustness / input handling. 10

len2366233

9/5/2019 2:51:41 AM

Assignments will be marked on the basis of fulfilment of the requirements and the quality of the work. In addition to the marking criteria, marks may be deducted for failure to comply with the assignment requirements, including (but not limited to): • Incomplete implementation(s), and • Incomplete submissions (e.g. missing files), and • Poor spelling and grammar. Submit your assignment (all program source files plus your discussion document) to the Assignment

Write a Review

Programming Languages Questions & Answers

  Write a standalone method named count_letters

Write a standalone method named count_letters that returns the number of occurrences of a specified letter lines in an input string

  Give a pseudo-code description of a function

Give a pseudo-code description of a function that uses only D and Q (and no other variables or objects) and results in D storing the elements.

  Write a program that reads the data from the file

Write a program that - Reads the data from the file into an array of structure when the form is loaded and When "Display Hits" is clicked, based on the team selected from the list, displays the players from that team and their hits. The players are..

  Create text based or gui menu to perform the given functions

Create a text based or GUI menu to perform the following functions. Create your design in pseudocode and then code a RAPTOR program which generates output to the screenand a text file.

  Create the external javascript file.

Using a text or HTML editor modify your lab5xx.htm page (see above) and save it as lab6xx.htm.

  Discuss the linux process

Displaying Linux Processes (Optional) Time Required: 10 minutes Objective: View processes running in Linux.

  Create a directory called registration

All the pages you created in Assignment One should also be present in Assignment Two not just the new pages or modified pages.

  Write function to accept single argument-find prime number

Write down function named isPrime( num ) which accepts the single argument (num) and returns True if argument is prime, and False otherwise.

  What are the contents of given register

Memory location 2000H has the word 5000H stored in it. What does each location contain after INC BYTE PTR[2000H]. Also after DEC WORD PTR[2000H]

  Write down a program which compute the amounts of money

earl and larry each begin a full-time jobs in january 2013 and plan to retire in january 2061 after working for 48

  Computes the wind-chill factor for a given temperature

The user should be able to enter a temperature and wind speed via text boxes, then click a button to view the corresponding wind-chill factor in a separate text box. As part of your page, you should define a function named Wi ndChi 11 that accepts..

  Program to compute person-s body mass index

Write a program to compute person's body mass index? Create a modular program which calculates and display person's body mass index (BMI).

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