Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

SENG 211 – Midterm Exam Study Question

You are expected to design a “Vehicle Rental Corporation System”.

The requirements and rules of the system are given below:


1. The Vehicle Rental Corporation has three types of vehicle. These are car, motor and carrier.
• Each car has id, type, number plate, base price, airbag, gear type and age.
• Each motor has id, type, number plate, base price, and motor type.
There are two types of carriers. These are truck and bus.
• Each truck has id, type, number plate, base price, fuel type and tonnage capacity.
• Each bus has id, type, number plate, base price, fuel type and seat capacity.
2. The Vehicle Rental Corporation has two types of customers. These are person and company.
• Each person has customer id, name and driving license.
• Each company has customer id, name and year of incorporation.
3. Rules for customers to rent a vehicle:
• A person can not rent a carrier .
• A person can rent a car if he/she has B type driving license.
• A person can rent a motor if he/she has A2 type driving license.
• A company can rent only carrier.
4. Each vehicle has a cost according to their properties.
• For A Car:
1. The base price of the car will be given from the input file.
2. If a car has airbag, the cost will increase 100 YTL.
3. If the gear type of the car is automatic, the cost will increase 200 YTL, otherwise if
the gear type is manual, no increase will be done.
4. If the age of the car is less than 5 years then the cost will increase 50 YTL, otherwise
no increase will be done.
Example: A car will be rent by a person who has B type driving license.
The car has an airbag. The gear type of the car is automatic. The age of the car is three.
Cost of the car for rent: Base Price + 100 + 200 + 50
• For A Motor:
1. The base price of the motor will be given from the input file.
2. If the type of the motor is a scooter, the cost will increase 50 YTL. If it is a motorbike,
the cost will increase 100 YTL.
Example: A motor will be rent by a person who has A2 type driving license. It is a scooter.
Cost of the motor for rent: Base Price + 50
• For A Truck:
1. The base price of the truck will be given from the input file.
2. The cost will increase 100 YTL per tonnage.
3. If the fuel type of the truck is fuel oil, the cost will increase 30 YTL. If it is diesel, the
cost will increase 40 YTL.
Example: A truck will be rent by a company. The tonnage capacity of the truck is 16 ton. The fuel
type of the truck is diesel.
Cost of the truck for rent: Base Price + 16*100 + 40
• For A Bus:
1. The base price of the bus will be given from the input file.
2. The cost will increase 10 YTL per seat.
3. The fuel type cost is the same with the truck.
Example: A bus will be rent by a company . The seat capacity of the bus is 40. The fuel type of the
bus is fuel oil.
Cost of the bus for rent: Base Price + 40*10 + 30
System Properties

Your system must be able to do followings:

• The vehicles will be shown with their type, id and number plate properties.
• The vehicles will be shown with their type, id and cost properties.
• Customer and vehicle IDs are needed to rent a vehicle. Renting rules must be handled. For
instance, A Person can rent only vehicles that are available for Person, a Person cannot rent a
Car if he/she doesn't have a B type driving license, a Company can rent only vehicles that are
available for Company, etc.

You are not supposed to develop the whole system. Input data is in files, and another developer will
be responsible to read input from files. However, it is your responsibility to design an interface
containing the methods you need. The other developer will implement your interface to read input
from files, and return to your part of the program.

Generate the class diagram to design your system, put necessary properties and methods, and
implement the critical parts only. You are not supposed to develop a complete, running program. Do
not try to code each requirement in detail!

You might also like