Professional Documents
Culture Documents
CSC2071 - Lecture 26 (Mid Exam Solution)
CSC2071 - Lecture 26 (Mid Exam Solution)
CSC2071
Lecture No. 26
Muhammad Shahid
Department of Computer Science
National Textile University
shahid.abdullah@hotmail.com
Recap
Interfaces
− What are Interfaces and why need them?
− Characteristics of Interfaces
Implementation of Interfaces
− Single Interfaces
− Multiple Interfaces
− Handling Ambiguity while Implementing Interfaces
Abstract Class vs. Interface
1
What Will You Learn Today?
2
Question No. 1
2) Write properties for all instance variables of this class with the
conditions that name, and diagnosis cannot be empty, and age
cannot be in negative and cannot be more than 130 years.
4) The hospital need to know how many patients have they admitted,
so you have to write a method named GetNumberOfPatients() to
return number of patients admitted yet.
5) Write copy constructor for the class Patient such that deep copy
can be generated. What problem(s) may occur when we copy
objects without using deep copy constructor?
5 Object Oriented Programming – CSC2071
Question No. 2
3
Question No. 2
Question No. 2
4
Question No. 2
Questions