0% found this document useful (1 vote)
188 views

Assignment 3

The document provides instructions for an assignment to create a C++ program that models vehicles using classes. Students are asked to create a Vehicle class with attributes for registration, make, year, and value, and methods to get/set these attributes and calculate age. The program must create 3 Vehicle objects, display their info, delete the first, display the object count, change values of the 2nd and 3rd, add a 4th object, and delete the 3rd object. Guidelines specify adding comments, submitting via slate or email, and penalties for plagiarism.

Uploaded by

'Hasan Habib'
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
188 views

Assignment 3

The document provides instructions for an assignment to create a C++ program that models vehicles using classes. Students are asked to create a Vehicle class with attributes for registration, make, year, and value, and methods to get/set these attributes and calculate age. The program must create 3 Vehicle objects, display their info, delete the first, display the object count, change values of the 2nd and 3rd, add a 4th object, and delete the 3rd object. Guidelines specify adding comments, submitting via slate or email, and penalties for plagiarism.

Uploaded by

'Hasan Habib'
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 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:


[email protected]

Section C & D will send their assignments to:


[email protected]

You might also like