Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Computer Science and Information Technology

Overview

NOTE: Carefully read this document. In addition, regularly follow the Canvas assignment discussion board for assignment related clarifications and discussion.

For this assignment you need to write a console application in the Java programming language which allows a company called FlexiRent to manage the renting and maintenance of various types of rental apartments in Melbourne CBD. Unlike traditional hotels, FlexiRent offers stylish 1, 2, and 3­bedroom Apartments and Premium Suites for short­term stays in Melbourne.

Implementation Requirements

General Implementation Requirements

• Although you are not required to use more than one class per task, you are required to modularise classes properly. No method should be longer than 50 lines.
• You should aim to provide high cohesion and low coupling.
• You should aim for maximum encapsulation and information hiding.
• Your coding style should be consistent with Java coding conventions
• You should comment important sections of your code remembering that clear and readily comprehensible code is preferable to a comment.
• It is not necessary to use dynamic data structures to store the input data (i.e. it is fine to define a fixed size data structure taking into account the maximum possible amount of input data).
• Your programs will be marked with Java SE 8.0. Make sure you test your programs with this setting before you make the submission.

Main Implementation Requirements

Your Rental Record class must meet the following requirements:

• Override the public String toString() method to print the details of a rental record in the following format:

recordId:rentDate:estimatedReturnDate:actualReturnDate:rentalFee:lateFee
(notice how the colon is used as a separator)

• Implement a public String getDetails() method. This method should build a string and return that string. The returned string should be formatted in a human readable form as shown below. This method SHOULD NOT do the actual printing to the console. Please refer to the following examples:

Implementation requirements for all rental property classes (Apartment and Premium Suite)

Each rental property must maintain its own collection of rental records. These records store information about the 10 most recent times that property has been rented.

• In assignment 1, you are required to use an array to implement that rental record collection, in which the first element of the array is always the latest rental record, the second element of the array is always the second latest rental record, and so on.

• If the rental record array is full, then the oldest rental record (the one at array index number 9) will be removed.Then all rental records in the array will be shifted to the next position in the array while their orders are preserved, and the latest record will be inserted at the beginning of the array (at array index number 0).

The following methods can be called on any object of type Apartment or Premium Suite:

(Hint: implementing these methods is a good chance for you to apply inheritance and polymorphism in your code)

public boolean rent(String customerId, DateTime rentDate, int numOfRentDay)

This method is called on a rental property object (either an Apartment or a Premium Suite) to perform the operations required to rent this property.

This method should check for pre­conditions to determine if that property can be rented. For example, this method will return false when that property is currently being rented or is under maintenance. You should check any other possible conditions which would make this method return false.

If the property is available for rent, this method will perform all necessary operations to update the information stored in this property object based on the input parameters. For example, updating the property status, creating a new rental record, updating the rental record array, and any other operations you consider necessary.

Finally, this method will return true if the property can be rented successfully.

public boolean return(DateTime returnDate)

This method is called on a rental property object (either an Apartment or a Premium Suite) to perform the operations required to return this property.

This method should check for pre­conditions to determine if that property can be returned. For example, this method will return false when the given returnDate is prior to the rentDate stored in the rental record. You should check any other possible conditions which would make this method return false.

If the property can be returned, this method will perform all necessary operations to update the information stored in this property object based on the input parameters. For example, updating

the property status, updating the corresponding rental record with the rental fee, the late fee, and any other operations you consider necessary.

Finally, this method will return true if the property can be returned successfully.

public boolean performMaintenance()

This method is called on a rental property object (either an Apartment or a Premium Suite) to perform the operations required to perform the maintenance of that property

This method should check for pre­conditions to determine if maintenance operations can be performed in that property. For example, this method will return false when the property is currently being rented. You should check any other possible conditions which would make this method return false.

If the property is ready for maintenance, this method will perform all necessary operations to update the information stored in this property object when a maintenance happens. Finally, this method will return true if the property is now under maintenance.

public boolean completeMaintenance(DateTime completionDate)

This method is called on a rental property object (either an Apartment or a Premium Suite) to perform the operations required when the maintenance of that property is finished.

This method should check for pre­conditions. For example, when this property is currently being rented, it does not make sense to call completeMaintenance method on this property object, and therefore this method should return false. You should check any other possible conditions which would make this method return false.

If it is possible to complete maintenance, this method will perform all necessary operations to update the information stored in this property object now that maintenance has been finished. Finally, this method will return true to indicate that the maintenance of this property has finished.

public String toString()

This method should build a string and return it to the calling method. The returned string should be formatted in a pre­defined format as shown below:

propertyId:streetNumber:streetName:suburb:propertyType:numOfBedRoom:status

(Notice how the colon is used as a separator. If that property is a Premium Suite, the attribute lastMaintenanceDate is appended.)

Example 1: A 2­bedroom Apartment is available for rent, having id A_108CRSB and address 108, City Road, Southbank. Calling toString should return the following line:

A_108CRSB:108:City Road:Southbank:Apartment:2:Available

Example 2: A Premium Suite is currently being rented, having id S_63WMSB and address 63, Whiteman Street, Southbank, and its last maintenance date is 22/07/2018. Calling toString should return the following line:

S_63WMSB:63:Whiteman Street:Southbank:Premium Suite:3:Rented:22/07/2018

public String getDetails()

This method should build a string and return it to the calling method. This method SHOULD NOT do the actual printing. The returned string contains all information about the rental property, including details about up to 10 most recent rental records of that property. The returned string should be formatted in a pre­defined human readable format.

Implementing the FlexiRentSystem application class

You are required to implement a class named FlexiRentSystem which will contain one single array to store up to 50 objects of both type Apartment and Premium Suite. Objects of type Apartment and Premium Suite will be added during runtime by the user of your program in the command line using a menu system described below.

Your FlexiRentSystem class should present the following menu for employees of FlexiRent company to manage rental properties.

User should enter a number from the menu above to select an option. If the input is outside of that range, an error message should be displayed and the menu should be re­displayed. When a valid number is entered, your program should execute the corresponding method and then return to the menu. Your program should exit if the user selects the Exit Program option.

You may use a sub menu under an option.

All output data should be printed to the standard output.

Following is a description of each feature provided by the menu above:

Add Property

The user (an employee of FlexiRent) selects this option to create a new rental property. The user can enter all relevant details of a new property, such as property id, property type, street number, street name, suburb, number of bedrooms, (last maintenance date if it is a Premium Suite)

You should perform all necessary data validation, for example, invalid property id or property id already exists. If there is an error, your program should print an appropriate error message to the console should go back to the menu immediately without creating or storing a new rental property.

Rent Property

By selecting this option, an employee of FlexiRent can then enter a property ID and enter relevant information for a customer to rent that property.

Return Property

By selecting this option, an employee of FlexiRent can then enter a property ID and a return date to return that property. If a return is successful, your program should print all relevant information about that property, including information about the latest rental record. See the example below.

You should perform all necessary data validation, for example, if that property is currently under maintenance, it's not reasonable to return that property.

Property Maintenance

By selecting this option, an employee of FlexiRent can then enter a property ID to put that property under maintenance. You should perform all necessary data validation to avoid any unreasonable scenario.

Complete Maintenance

By selecting this option, an employee of FlexiRent can then enter a property ID to complete maintenance of that property. From the ID, if that property is a Premium Suite, then the system will prompt the employee to enter a maintenance completion date.

Display All Properties

By selecting this option, an employee of FlexiRent can see on the Console all information about all rental properties stored in the system, including details about up to 10 most recent rental records of each property. (Hint: calling the getDetails method on each rental property object)

Start­up Class.

You should create a startup class which contains a main method in which an object of the FlexiRentSystem class is created and a single method is called on that object to run the entire FlexiRentSystem application.

Design Requirements

You must work out an object design for the above task. You should take advantage of object­oriented concepts such as composition, inheritance, method overriding, abstract classes, interfaces wherever appropriate.

Class hierarchies, relationships and components must be conceptualised in a relevant manner, based on the problem description and special conditions listed in this document. Furthermore, you must be able to explain how your program design will perform in certain scenarios and circumstances.

It may be necessary for your design to provide more functionality, such as accessors and mutators, than is specified in the above sections here for the mechanics of your design to work.

Attachment:- Assignment - Advanced programming.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M93050076
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in Java

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As