Mid Oop
Mid Oop
minutes marks
Object Oriented
Programming
Section 06
Instructions:
• Indent your code.
• Comment your code.
• Use meaningful variable names.
• Plan your code carefully on a piece of paper before you implement
it.
• Name of the program should be same as the task name.
i.e. the first programshould be Task_1.cpp
• 20 marks will deduct if not done in multiple files.
• Make sure your submitted file is not corrupted.
• In case of ambiguity, make a suitable assumption
• Plagiarism will result in severe consequence.
• Lastly, do not forget to stay confident
Good luck
Task 2: (30
marks)
Create a class Distance which will have the following attributes (2 marks)
- int feet
- int inches
As we know
12 inches= 1 feet
So your program should modify feet’s whenever inches count is grater then 12
For example if your enter 12 feet 30 inches it will display distance as 14 feet 6
inches
else
cout << "d1 and d2 distance are not equal" << endl;
d1+
+;
d1.disply();
return 0;
}
90 65
minutes marks
Output: