COSC 237 1 Problem Description You are to develop a Java program, using an object-oriented design, capable of maintaining vehicle rental reservations for a vehicle rental agency that rents cars, SUVs...

1 answer below »

COSC 237

Problem Description
You are to develop a Java program, using an object-oriented design, capable of maintaining vehicle rental
eservations for a vehicle rental agency that rents cars, SUVs and trucks to corporate customers.

Problem Scenario
The agency offers various model cars, SUVs and trucks for rent to corporate customers (not private
individuals). Vehicles may be rented for a period of days, weeks, or months. Monthly rentals are cheaper
(on a daily basis) than weekly rentals, and weekly rentals are cheaper than daily rentals. There is also a
mileage charge and optional daily insurance. Rates differ for cars, SUVs and trucks. (There is no
difference in the rates among various model vehicles however.) Each corporate customer may choose
to be a “Prime Corporate Customer” for a yearly fee. Prime customers receive 100 free miles for each
individual rental.

Users of the System

There are two types of users of the system, Employees and Managers, described below.

Employees of the rental agency may do the following (refe
ed to as use cases in software development):
(1) view cu
ent rates (for a given vehicle type, including insurance rates and per mile charge), (2) view
available (unreserved) vehicles (cars, SUVs or trucks), (3) display estimated cost (for a given vehicle
type, expected rental period, expected number of miles to be driven, insurance option, and if a prime
customer), (4) reserve a vehicle (by credit card number) for a specific vehicle, rental period, and daily
insurance option (accept or decline), (5) cancel a reservation (by provided credit card number), (6) view
a specific corporate account (by credit card number) and (7) process a returned vehicle (by provided
VIN) which:

(a) calculates charge based on rates at the time reserved, number of days had the
vehicle, the number of miles driven, whether daily insurance was selected, and
whether a Prime customer (Prime customers get 100 free miles)
(b) removes the reservation for the returned vehicle
(c) creates/stores a transaction entry.

Managers of the vehicle rental agency may: (1) view/update cu
ent rates (including per mile charge
and daily insurance rates), (2) view all vehicles (each indicated as reserved or unreserved), (3) add
corporate accounts, (4) view a list of all cu
ent reservations, (5) view a list of all accounts, and (6) view
a list of all transactions (i.e., history of returned and paid rentals).

A use case diagram for the system is given on the following page.


Use Case Diagram
Vehicle Information

Vehicles are identified by a unique VIN (Vehicle Identification Number). The set of features
maintained for cars, SUVs and trucks are different. Cars are specified as a specific make and model, a
miles per gallon rating, and seating capacity. SUVs are specified as a particular make and model, a miles
per gallon rating, seating capacity, and cargo capacity. Trucks are specified as a particular length (in
feet), miles per gallon rating, and load capacity.

Following is the list of vehicles, including the given VINs that you must use for this assignment. ALL OF

NOTE: The output is NOT meant to be displayed as below. It is only presented this way for informational
purposes. (The list of vehicles should be displayed as shown in program requirement 1 below.)

Make/Model Mileage Seating VIN

Ford Fusion Hy

Make/Model Mileage Seating Cargo VIN
Capacity Capacity

Honda Odyssey 28 mpg XXXXXXXXXXcubic ft. VM9RF2635TD
Dodge Caravan 25 mpg XXXXXXXXXX cubic ft. QK3FT4273NE
Ford Expedition 20 mpg XXXXXXXXXXcubic ft. JK2HL8264HY

Make/Model Mileage Load VIN
XXXXXXXXXXTen-Foot 12 mpg 2810 lbs. EJ5KU2437BD
Eighteen-Foot 10 mpg 5950 lbs. KG4MD5372RK
Twenty-Four-Foot 8 mpg 6500 lbs. EB2WR3082OB
Twenty-Four-Foot 8 mpg 6510 lbs. TV3GH4390FK
Program Requirements
The following summarizes the requirements for this program:
1. The program must be able to maintain a collection of specific model vehicles of type Car,
SUV, and Truck, and be able to display the vehicles in the following format:
Ford Fusion (Car) MPG: XXXXXXXXXXSeating: 4 VIN: AB4EG5689GM
Honda Odyssey (SUV) MPG: XXXXXXXXXXSeating: 7 Storage: 6 cu. ft. VIN: QK3FT4273NE
Chevrolet Impala (Car) MPG: XXXXXXXXXXSeating: 4 VIN: RK3MB3366YH
Eighteen-Foot (Truck) MPG: XXXXXXXXXXLoad Capacity: 5390 lbs. VIN: KG4MD5372RK
2. The program must be able to maintain a set of cu
ent rates for Cars, SUVs and Trucks, and display
the rates in the following format, that can be updated when needed:
Car Rates Daily: $ XXXXXXXXXXWeekly: $ XXXXXXXXXXMonthly: $ XXXXXXXXXXPer Mile: $ XXXXXXXXXXDaily Insur: $14.95
3. The program must be able to provide an estimated cost of rental based on the vehicle type, expected
ental period, expected number of miles to be driven, insurance option, and whether a Prime
4. The program must allow vehicles to be reserved by a specific account customer, for a specific VIN,
time period, and daily insurance option.
5. The program must allow reservations to be cancelled (by a provided credit card number).
6. The program must process a returned vehicle to (a) display the amount due for the actual number
of days had and mileage driven (with 100 free miles for Prime Customers), (b) move the reservation
information to the transaction “file” (Transactions object), and (c) remove the reservation for the
given vehicle. To calculate the cost, the weekly or monthly rate will be applied, when applicable, with
any left-over days pro-rated at the weekly or daily rate (e.g., 40 days would be 31 days at the monthly
ate, and the remaining 9 days each at a rate of (monthly rate / 31).
7. The program must be able to display all reservations.
8. The program must allow corporate customer accounts to be created, storing the company name,
whether they are a prime customer, and credit card number.
9. The program must be able to display specific accounts (by credit card number) and also a list of all
corporate accounts.
10. The program must maintain a history of all completed transactions (i.e., when a vehicle is returned
and paid for). The information stored should include the name of the company, the company’s credit
card number, the type and model of vehicle rented, the number of days had, the number of miles
driven, and the total cost displayed as follows:

XXXXXXXXXXABC Company (card # XXXXXXXXXX), Car: Ford Fusion, 3 days, 540 mi., $120.54
Following are the rental rates, per mile charges, and insurance rates that you must use for each vehicle type:

ent Rental Rates

Daily Weekly Monthly
Rate Rate Rate
Car $24.95 $169.95 $514.95

SUV $29.95 $189.95 $679.95

Truck $36.95 $224.95 $687.95
Mileage Charge: XXXXXXXXXX / mile for cars and SUVs 0.26 / mile for trucks
Insurance Rates: $14.95 / day for cars and SUVs $21.95 / day for moving trucks

How Rental the Rates are Handled

The rental rates for all three vehicle types (Car, SUV and Truck) have the same information, as shown above,
only the values differ. Therefore, the abstract VehicleRates class contains all of the needed variables, and the
implementations for all needed methods. It is declared abstract NOT because it contains any abstract methods,
ut so that object instances of type VehicleRates cannot be created. It is the three subclasses of the VehicleRates
class (CarRates, SUVRates and TruckRates) that are instantiated, so that it is known which vehicle type a given
set of
Answered 1 days AfterApr 07, 2022


Roshan answered on Apr 09 2022
15 Votes

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here