Anda di halaman 1dari 2
UNIVERSITI SAINS MALAYSIA School of Computer Sciences Session 2011/2012, Semester 2 CPT113: Programming Methodology & Data

UNIVERSITI SAINS MALAYSIA

School of Computer Sciences Session 2011/2012, Semester 2

CPT113: Programming Methodology & Data Structures ASSIGNMENT ONE

Car Rental Management System

Hertz, the world's leading vehicle renting organization, operates from approximately 7,700 locations in 145 countries worldwide. Hertz is the largest general use car rental brand in the world, and the number one airport car rental brand in the U.S. and at 69 major airports in Europe, operating both corporate and licensee locations in cities and airports in North America, Europe, Latin America, Australia and New Zealand. In addition, the Company has licensee locations in cities and airports in Africa, Asia, and the Middle East. Today, Hertz's Worldwide Product such as Green Collection, Compact/MidSize, Full Size, and SUV offered through the company. Reservations Centers handle approximately 40 million phone calls and deliver approximately 30 million reservations annually.

Write a program to assign customer reservation for Hertz Car Rental System.

Assume a car rental system with reservation as follows:

January

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

February

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

March

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

April

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

May

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

June

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

The program should display the reservation pattern, with an ‘X’ marking the cars already taken. For example, after JanuaryGreenCollection, FebruaryCompact, and MarchFullSize are taken, the display should look like:

January

X

Compact/MidSize

Full Size/Standard

SUV/MiniVan

February

Green Collection

X

Full Size/Standard

SUV/MiniVan

March

Green Collection

Compact/MidSize

X

SUV/MiniVan

April

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

May

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

June

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

January

Green Collection

Compact/MidSize

Full Size/Standard

SUV/MiniVan

After displaying the cars available, the program prompts for the month and cars desired. The user type in a month and car, and then the display of available car is updated. This continues until all cars are filled or until the user signals that the program should end. If the user types in a car that is already taken, the program should say that the car is not available and ask for another choice.

Requirements:

  • 1. Define class and represent using the UML Diagram Tips: Define a class called Month that is an abstract data type for a month. Your class will have a one member variable of type int to represent a month (1 for January, 2 for February, and so forth). Include all the following member functions: a constructor to set the month using the first three letters in the name of the month as three arguments, a constructor to set the month using an integer as an argument (1 for January, 2 for February, and so forth), a default constructor , an input function that reads the month as an integer, an input function that reads the month as the first three letters in the name of the month.

  • 2. Write the program that includes:

    • a. Constructor and Destructor

    • b. Inheritance

    • c. Friend Class

    • d. Operator Overloading

    • e. Linked List