Académique Documents
Professionnel Documents
Culture Documents
Task 2:
For task 1 call calcGrade() function using this operator in getScore() function to show static
binding i.e. now whether getScore() is called with the instance of Grade or Test it will calculate
grade for Grade classs score.
Task 3:
For task 1 now use virtual function calcGrade() and then call in getScore() function to show
dynamic binding. i.e. now when getScore() is called with the instance of Grade it will calculate
grade for Grade classs score. And when called with Test it will calculate grade according to Test
class Score.
Task 4:
Define a class person with data members name, address, contact #, height_in_meters,
weight_in_kg. Define a member function Calc_BMI() which will calculate BMI according to
following formula and display these results.
BMI= weight_in_kg/ height_in_meters^2