Вы находитесь на странице: 1из 2

National University of Computer and Emerging Sciences

Islamabad.
Programming for Engineers-II
Sections-A, B, C, D
Assignment # 3
Marks=100
Semester: Spring 2011
Due Date: 12th March, 2011
Instructors: Qurat-ul-Ain/Nisar Ahmad
In this assignment you have to write a complete program in VC++ 6.0.

A class called Vehicle is required by a programmer who is writing software for a car dealer. An
object of the class Vehicle will consist of a registration number, the make of the vehicle, the year
of manufacture and the current financial value of the vehicle. The first three of these will need to
be set only at the time an object is created. The current value will also be set at the time of
creation, but may need to be changed during the vehicle's lifetime.
It will also be necessary to have a means of reading the values of all the above data items. A
method should also be provided which accepts a year as input, and returns the age of the vehicle.

Required Functions:

1) Constructor(s)
2) Get Function for every attribute of the class
3) Appropriate Set Functions.
4) Static Data Member for keeping track of the objects created.

Write a C++ program that


 Creates 3 objects of the class vehicles.
 Then display all information of these 3 vehicles.
 Then delete 1st object and display the total number of objects of the class.
 Change the financial values of 2nd and 3rd object of the vehicles and again display their
details. [using cascaded Member function call]
 Add another vehicle(create another object of class vehicle)
 Display details of this newly created vehicle
 Delete third object

Note: Check the number of created objects after every addition or deletion of object. Display this
number on screen after this.

Guidelines:

 Write comments regarding each member attribute and method.


 Submit your assignment at slate web portal
o Go to “Messages”
o Attach assignment
o Select ROLE of LAB INSTRUCTOR
o Send
 Zero Marks for Copied Assignment (For both parties- those who copy the
assignment and also for the person who give assignment for copy]-for all
assignments

Submission by Email (if Slate is not working)

Subject: Assignment02_prog2

Submit ONE ZIP file named according to your roll-no (e.g. 10-0xxx.ZIP).

Section A & B will send their assignments to:


attique.dawood@nu.edu.pk

Section C & D will send their assignments to:


hina.ashraf@nu.edu.pk

Вам также может понравиться