Spring 2023 - CS304 - 2
Spring 2023 - CS304 - 2
Spring 2023
Assignment # 02 Due Date : July 13,
2023
Please carefully read the following instructions before attempting the assignment.
You should consult the recommended books to clarify your concepts as handouts are not sufficient.
Topic Covered:
● Lecture 21-36
Uploading instructions:
● Your assignment should be in .CPP format (Any other formats like scan images, PDF, zip, doc, rar
and bmp etc. will not be accepted).
● Save your assignment with your ID (e.g. bc000000000.CPP).
● No assignment will be accepted through email.
NOTE:
No assignment will be accepted after the due date via email in any case (whether it is the case of load
shedding or internet malfunctioning etc.). Hence refrain from uploading assignments in the last hour of the
deadline. It is recommended to upload the solution file at least two days before its closing date.
If you find any mistake or confusion in the assignment (Question statement), please consult with your
instructor before the deadline. After the deadline, no queries will be entertained in this regard.
Consider you are working as a software developer in a company that manufactures vehicles. The company produces different types of vehicles,
including cars, motorcycles, and trucks. Each vehicle has a unique identification number and a maximum speed. Some vehicles have the capability
to transport passengers, while others can transport goods. Additionally, some vehicles have a towing capacity.
Your task is to implement the classes and handle the Diamond Problem, ensuring that the correct properties and behaviors are accessible to each
class.
Methods tow()
displays a message indicating that the truck is towing as shown in the
screenshot.
Write main() to create pointer to Truck class and call the following functions using Truck class pointer:
displayVehicleDetails()
transportPassengers()
transportGoods()
tow()
Sample Output:
Best of Luck