Write a C++ program that creates a class Mathematician with the
data members such as name, address, id, years_of_experience and
degree and create an array of objects for this class.
Include public member functions to
i) Input() – This function should read the details
of an array of Mathematicians by passing array of objects and array
size (n)
ii) Display() – This function should display either the
details of an array of Mathematicians or a Mathematician with
highest experience by passing array of objects, array size (n) and
user’s choice (1 or 2) as the argument to this function.
Note:-
Write the main function to
Create an array of objects of Mathematician based on the user’s
choice (get value for the local variable ‘n’ and decide the size of
the array of objects)
Input details into the array of objects.
Finally, either display the complete set of Mathematician
details or display the details of Mathematician with highest years
of experience based on the user’s choice.
(1 – display the complete set of Mathematician
details)
or
(2 – display Mathematician with highest experience details
only)
You may decide the type of the member data as per the
requirements.
Output is case sensitive. Therefore, it should be produced as
per the sample test case representations.
‘n’ and choice should be positive only. Choice should be either
1 or 2. Otherwise, print “Invalid”.
Write a C++ program that creates a class Mathematician with the data members such as name, address, id, years_of_experie
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am