Develop an application to hold details of all the cabins

Assignment Help JAVA Programming
Reference no: EM13865385

Overview

A holiday resort provides cabins for travellers to stay in overnight.

A ‘cabin' is a small wooden hut, containing bunk beds, table and chairs, a heater, and a small cooking area. Often the traveller will use the general campsite facilities for washing and showering. Some cabins are more expensive, and may have separate bedrooms and their own ensuite bathroom.

Each cabin has a fixed price, regardless of whether all the beds are used or not. Small cabins are usually hired by individuals or couples, larger ones by families. Travellers hire the whole cabin, not a bed in a cabin.

Each cabin has a named owner. For this course, you can assume that owner names are unique.

In this assignment you will develop an application to hold details of all the cabins on the site, including their cost per night, and produce a report which includes a list of cabins and some summary statistics.

You should be able to make a start on your Cabin class after the first few lectures, and you will be able do most of the assignment after ArrayLists have been covered. You can finish it after the lecture on file i/o and exceptions.

In other accommodation types e.g. Hotel-room you should focus on using fields, which refer to a realistic booking option, e.g. Double room or single room.

Stage One - development your cabin class

The application is all about cabins, so there should be a cabin class. Develop your cabin class, and, using a main method, create several cabins and test the methods.

Don't use input or output files or any sort of graphical user interface in this stage. Just develop your cabin class, without the list of costs. Using a main method, create several objects of the class, and test all your methods, which you will use in the next stage.

Details for each cabin should be held in a class named either NameCabin (where Name is your initials) or some more specific name e.g. ArgyllHolidayVillage. Develop this class, according to the requirements that are listed below. Some of these requirements are described fully, and in other cases you have to make some of your own decisions.

When you have to make your own decisions, don't make the same decisions as your friends. You will lose marks if you hand in work in which all design decisions and code structures are identical to those of other students.

Your cabin class - Instance variables

For each cabin, you should hold the following essential information in instance variables:
• Cabin number e.g. 8
• Number of beds, from 2 to 8.
• Facilities - decide on two or three categories of cabin which will affect the price. For example, whether ensuite or not.
• Owner - just store the name, and assume this will be unique. Use the Name class.

You should also include some extra information (choose this to make your coursework a little different from that of your friends). Students working alone should include 2 extra items, and students working in pairs should include 4 extra items. Suitable extra information might be related to appearance, age or size. But you can choose anything sensible. There are classes in java to store dates, but they are a little complicated, so for this assignment you could either: investigate how to do this; restrict date information to the year; not store date information.

Your cabin class - Methods

The cabin class should have (use exact method names please):

• A Constructor, and get and set methods.

• A getCost() method which returns the cost of the cabin for one night. The cost should be the same all the year round. Invent your own pricing algorithm, which should be different to that of other students. You should take the type of facilities and number of beds into account, and maybe one or two of the extra details. Use class constants rather than literals in your calculation.

• AgetFullDetails() method which returns a String containing all the details of the cabin (including your extra attribute) as text. It should be clear what all the values are.

• AgetShortDetails() method which returns a String containing ONLY the cabin number; the cost; the owner initialsrather than full name; the number of beds in the cabin; the cost for one night.

Stage Two -alter your cabin class

In this version, all the cabins need to be hard-coded in a populatemethod, and output printed to System.out. In the final version, you will use text files.

Add and test the following features:

1. In the Cabin class, replace the simple ‘number of beds' by showing the number of beds in each room in the cabin, using an array of integers. E.g. :
• one room, 2 beds {2}
• three rooms, two with 2 beds and one with 3 {2,2,3}
There should be a method to return the total number of beds in the cabin.

2. Introduce a Managerclass and a CabinList class to contain an ArrayList of cabins, containing between 10 and 20 cabins, with features carefully chosen to test all your methods. All costs should be displayed showing 2 decimal places, e.g. 12.50. This class should include methods to:
• Return text consisting of details of all the cabins. These details should be formatted into a table, and should include the cabin number; the cost; the owner initials; the number of beds in the cabin rather than the beds per room; the cost for one night; anything else that you think should be included.
• Return a cabin object corresponding to a cabin number which is provided as a parameter.
• Return text giving full details of a single cabin, corresponding to the cabin number provided as a parameter. Use the previous search method then produce text containing all details, including the full name of the owner and full details of beds and rooms.
• Return the maximum income that the site could get per night - the sum of the cost of each cabin
• Return the cost of the cheapest cabin
• Return the cost of the most expensive cabin
• Return the number of cabins on the site
• Return a frequency report of your choice. Decide whether using a frequency array is useful for your choice. Examples:

a. The number of cabins with particular facilities

b. The number of cabins sleeping 1,2, 3, ..., 8 people

Using a main method, create several objects of the class, and test all your methods.

Stage Three

Replace your populate method with a method to read in the cabin data from a text file. Include a few errors in the text file and improve your program to cater for these errors, outputting a useful message and ignoring the line with the error.

Alter your program so that the frequency reports and other statistics obtained in (2) above are written to a text file.

You should provide a report on your program, consisting of the following information (nothing else):

1) Your decisions
a. Which extra accommodation attributes you chose
b. How the overall cost is calculated. Include an activity diagram.

2) Status report. Does your program meets the specification fully, or is it incomplete? This can be very brief (don't provide a list of everything that you were asked to do - the marker knows this). E.g.
• "This application meets the specification fully"
• "The application does everything except allowing the user to enter a accommodation number"
• "This application meets the specification almost completely but I know the cost calculation isn't always correct "
For the following lists and tables, there are examples in the Testing lecture.
• If necessary, a list of known bugs and a list of requirements that you have not implemented.
• Include a table of limitations - these are things that you decided not to handle, either through lack of time or because you think that they are unlikely to occur.
• Include a table of tests done.

3) Diagrams
• Class diagram showing all classes with instance variables, methods and associations
• A sequence diagram showing a task of your choice, but using at least 2 classes. E.g. reading the input file or creating a report.

4) Write javadoc style comments for the CabinList class, and generate the html. Hand in a printed copy of the html generated for the CabinList class.

Reference no: EM13865385

Questions Cloud

What does customs border authority entail : What does Customs border authority entail? Border authority is only done so by ‘customs officers which include, officers of Bureau of Customs of the Treasury Department, commission warrant
Organic chemistry of thermochemical processing : Provide concise answers to the following questions about the organic chemistry of thermochemical processing: 1. List and indicate the structural formula for functional groups important to biomass chemistry.
Characteristics of soil horizons : Describe the components of soil, characteristics of soil horizons, as well as processes of soil formation and development. Explain soil properties, to include soil color, grain size, structure, and moisture
Define the meaning of the term supply chain : Define the meaning of the term "Supply Chain." The term is used rather freely these days, but what does it actually mean?
Develop an application to hold details of all the cabins : Develop an application to hold details of all the cabins on the site, including their cost per night, and produce a report which includes a list of cabins and some summary statistics.
The triune brain : The Triune Brain: Your Brain The reptilian brain, the oldest of the three, controls the body's vital functions such as heart rate, breathing, body temperature and balance
Parameters and write a simple recursive subroutine : Learn to pass parameters and write a simple recursive subroutine.
Statement to explain what happened at motorola : Could you use this statement to explain what happened at Motorola when they missed the digital mobile phone market opportunity (Crockett & Elstrom, 1998)
Develop case-specific effect-cause-effect logic tree diagram : Use a systems approach to analyze OCI's performance and develop a case-specific "effect-cause-effect logic" tree diagram using the 5-Whys tool

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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