Question: 1. Write a C++ program to implement the Multilevel Inheritance on the following. Create the class Student with Student number (snum), Student (sname) and

1. Write a C++ program to implement the Multilevel Inheritance on the following.  Create the class Student 

1. Write a C++ program to implement the Multilevel Inheritance on the following. Create the class Student with Student number (snum), Student (sname) and degree (deg) as data members and the member functions as: getstud(): gets snum, sname and deg. showstud(): prints snum, sname and deg Create the class Marks with marks in three subjects m1, m2, m3 as data members and the member functions as: getmark(): gets m1, m2 and m3 showmark(): prints m1, m2 and m3 Derive the class Marks from the class Student in public mode > Create the class Result with total marks (total), average (avg) and grade (gr) as data members and the member functions as: Calresult(): Calculate the total marks and displays the average CalGrade(): Calculates Grade and displays the Grade. If Average (60-100) If Average (40-59): If Average (0-39): grade A grade B grade C Showresult():displays avg, tot and gr Derive the class Result from the class Mark in public mode. 2. Write a C++ program to read two time objects t1, t2 in the form of years and weeks by encapsulating them in a class time. Add these two time objects t1 and t2 by sending the object t2 as an argument to addtime( ) and then return the result to another time object t3 (Note: 1 year =52 weeks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!