The objective of this assignment is to design and implement a tool rental management system (for stores such as Home-Depot) using the MVC compound pattern. The project can ONLY be implemented using either Java or C#. The system is made of the following entities:

1. Customers: They rent tools in the rental system. Customers are stored in a file called "Customers.txt".

2. Tools: These are the objects to be rented. Tools are stored in a file called "tools.txt".

3. Rental_data: These are the recorded information about who rented which tool, the date of rental, and date of return. Rental_data are stored in a file called "rental_data.txt".

File Structure Requirements

Customers.txt

Customer_id; name; deleted
if deleted=false then the Customer is active in the system, if deleted=true then the Customer is logically deleted.
Examples:
300; Thomas Jefferson; false (active customer)
200; John Smith; true (deleted customer)

tools.txt

tool_id; tool_name; rented
if rented=false then it is available (not rented), if rented=true is rented.
Examples:
1; Drills & Drivers; false
2; Bolt Cutters; true
3; Handheld Sanders; true

rental_data.txt

rental_id; customer_id; tool_id; date_out; date_in
date_out and date_in should be stored in format mm-dd-yyyy (if the tool has not been returned, then date_in should be empty).
Every time a tool is rented, a record should be placed in the file “rental_data.txt”, and a record is updated every time a tool is returned.
Examples:
10; 300; 1; 9-30-2017;
11; 300; 2; 9-30-2017; 11-02-2017
In the first case shown above, the customer Thomas Jefferson rented the tool “Drills & Drivers” on 9-30-2017
In the second case shown above, the customer Thomas Jefferson rented the tool “Bolt Cutters” on 9-30-2017 and returned it on 11-02-2017.

Required Functionalities

The system should implement the following transactions:

For Customers:

  • Create a Customer
  • Delete a Customer. A Customer does not get physically deleted from the system. A flag in the record in file just states if the Customer is "logically" deleted
  • Search a Customer by last name, or by first name, or by both. If search by last name (or first name), all the customers with that last name (or first name) will be displayed
  • Show all active Customers
  • Show all deleted Customers

For Tools

  • Search a tool by name
  • Rent a tool
  • Return a tool
  • Show all tools, showing current rented tools first
  • Show current rented tools
  • Show who has historically rented a particular tool, sorting in descending order by date of rental

Design Requirements of Using MVC

Your design must follow the dynamics of the Model-Viewer-Controller design, which includes the following requirements:

  • have at least ONE interface for the Model, at least ONE interface for the View, and at least ONE interface for the Controller
  • each concrete Model class should contain a reference to the ViewInterface
  • each concrete Controller class should contain a reference to the ModelInterface. In addition, each concrete Controller class should contain a reference either to the ViewInterface or to the concrete View class

The model consists of the classes that represent data, as well as the classes that load, store, look up, or operate on data. These classes know nothing about what information is displayed to the user and how it is formatted. Rather, the model exposes observer methods the view can call to get the information it needs. In general, functionalities of the model include:

  • Reading data from the data source (text file, database, etc.) to an in-memory representation.
  • Storing data while the program is running.
  • Providing methods for the view to access data.
  • Performing computations or operations involving the data and returning the result.
  • Updating the in-memory state (if the application allows the user to modify data).
  • Writing to the data source (text file, database, etc.)

The view implements the user interface. It should store as little data and perform as little computation as possible; instead, it should rely on the model for data storage and manipulation. The view decides how the user sees and interacts with this data. Does the user interact with a text interface (command lines) or a GUI?

The controller listens to user input and handles all user interactions. Based on the user's keystrokes, mouse clicks, etc., the controller determines their intentions and dispatches to the appropriate methods that are implemented in the model or view.

Implementation Requirements

  • Every time the application starts, it should allow the system to find/choose the location of the files.
  • A Customer can rent at most 3 tools at a time. If a Customer tries to rent a 4th tool, the system must deny the request.
  • The current rental business only keeps one copy of a tool. If a customer tries to rent a tool that is currently rented, the system must tell that the tool is not available.
  • You MUST use GUIs for all user interactions.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.