Purchase Solution

Java Programming: Rental Information Maintenance Application

Not what you're looking for?

Ask Custom Question

Create an efficient Object-Oriented Java application that maintains information about college roommates who are renting a house together, for their realtor.

When a house is chosen by the roommates, the user will provide information for it. To allow extensibility, a house object can be created with no information available, the address of the house only or the address of the house, monthly rent and security deposit.

The House class definition should include following instance variables:
- Address
- Number of roommates
- Monthly rent
- Security Deposit

The above class definition should also include following instance methods:
- Validating mutators for the numeric instance variables that are to receive values from the user (including monthly rent - must be between the minimum of $400 and the maximum $2500, and the security deposit - must be between $250 and the monthly rent of the house)
- addARoommate(), that will allow the user to include an additional roommate on the lease (not to exceed the 4 roommate limit - this is a maximum imposed by the realtor for any house)
- Accessors for the instance variables, as well as a toString() method to gather all pertinent information.
- Amount owed by each roommate for individual monthly rent
- Amount owed by each roommate for the entire 12 month lease (which includes their portion of the Security Deposit)

The Realtor application that implements the class described above should prompt the user for the house's address, monthly rent and security deposit. Then the application should process as many roommates (up to 4) the user chooses. The output should include the information on the house (Address, Monthly Rent, and Security Deposit and Total Yearly Income) as well as the number of roommates and their monthly and total financial obligation.

Only one house object is to be manipulated by the application.

Purchase this Solution

Solution Summary

As nothing is specified about what action to take in validating mutators in case user supplied values do not match the criteria, this solution simply prints the message to the user and ignores the value change request.

Solution Preview

Please unzip the attachment 525080.zip and change directory to 525080 folder. There, at command prompt, type following command to compile the program:

javac RealtorApp.java

After succesful compilation you can run the application as:

java RealtorApp

Java version 1.7.0_03 was used during the development of the attached program that consists of two files - House.java and RealtorApp.java (test driver class). Code is well commented to make it easier to understand and modify.

Note that computation of "Total Yearly Income" does not include security deposit as that is refundable amount. ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.