You are on page 1of 2

CC-211 Object Oriented Programming FALL 2022

Fundamentals

Assignment 03 – Vehicle Inventory


Average expected estimated time to complete this assignment is 12 hours

 [1 HOUR] software requirement understanding


o reading of the assignment document
o understanding of problem statement
o understanding of software inputs and outputs
 [2 HOURS] software design
o identification of user-software interaction sequences
 software menus
 user inputs and
 software flows
o identification of required variables and data structures to be used
 for input, processing, and output
 identification of storage class specifications of required variables
o modularization of software into required functions
 proper naming of functions
 identification of tasks to be performed into functions
 identification of parameters and return types of functions
o identification of user defined header files
 names and functions to be placed in
o flow sequence of main function and call of various user defined functions from it
 [6 HOURS] software coding
o coding of user defined functions
o placement of user defined functions into header file/s
o coding of main function
 [2 HOURS] software testing
o running software on various inputs
o identification of software error and bugs
o removal of software error and bugs
 [1 HOUR] software documentation
o proper indentation of code
o use of proper naming conventions
o commenting of code

Assignment 03 Page 1 of 3
CC-211 Object Oriented Programming FALL 2022
Fundamentals
Objectives:
 This assignment will provide experience with concepts of Inheritance and Polymorphism

Prerequisite Skills:
 Basic knowledge of mathematical calculations
 Understanding of Class design
 Understanding of Inheritance
 Understanding of Polymorphism

Overview:
Polymorphism is the third pillar of object-oriented programming (OOP) after encapsulation and
inheritance. Polymorphism allows an interface to be expressed in different ways. Real-world
examples are commonplace; for example, the taxonomy used in biology to classify organisms is
polymorphic.

In this assignment, you will create a program that models a vehicle inventory using polymorphism.
The inventory will contain several types of vehicles such as cars, trucks, and motorcycles, each of
which will have different properties and methods.

Problem Statement:
Instructions:
 Create a base class called “Vehicle” that has the following data members:
o make (string), model (string), year (integer), price (double)
The class should also have a virtual method called “displayInfo” that takes no parameters and
returns nothing.
 Create three derived classes: “Car”, “Truck”, and “Motorcycle” that inherit from the “Vehicle”
base class.
o The “Car” class should have an additional data member called “numDoors” (integer).
o The “Truck” class should have an additional data member called “bedSize” (string).
o The “Motorcycle” class should have an additional attribute called “engineSize” (double).
All derived classes should override the “displayInfo” to display its specific vehicle information.
The “Car” class should output the make, model, year, price, and number of doors.
The “Truck” class should output the make, model, year, price, and bed size.
The “Motorcycle” class should output the make, model, year, price, and engine size.
 Create a main program that creates several instances of each vehicle type, sets their properties,
and calls their “displayInfo” method to display them. Use a polymorphic approach to call the
“displayInfo” method of each vehicle object. The output of the program should be a visual
display of all the vehicles in the inventory.

Specifications:
Implement the following features to enhance the program:
 Implement a way to add new vehicles to the inventory.
 Implement a way to remove vehicles from the inventory.
 Implement a way to search for a specific vehicle by make, model, year, or price.
 Implement a way to sort the vehicles by make, model, year, or price.

File(s) to be submitted:
VehicleInventory.cpp, VehicleInventory.h, should be submitted to Teacher Assistant in the electronic
format i.e., softcopy.

Deadline: April 16, 2023. (11:59pm)


Assignment 03 Page 2 of 3

You might also like