Exercise 2: Students Average Marks
Calculate a student's average marks by using classes.
We'll cover the following...
We'll cover the following...
Problem statement
Write a class Student that contains the following data members and member functions, and performs the following operations:
Private data members:
floatdata members:mark1andmark2.intdata member:rollno
Public member functions:
Default constructor: Takes no parameters and initializes mark numbers to
0and the roll no to1.Parameterized constructor: Takes the three
privatedata members as arguments and sets them to given values.GetMarks(int marknumber)function: Returnsmark1ifmarknumberequals1andmark2otherwise.calc_average()function: Takes the two marks entered and returns their average.