Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Imagine a scientist class that stores the name (a string), age (type int) and no of publications (typeint) of a scientist. Write following functions for
- Imagine a scientist class that stores the name (a string), age (type int) and no of publications (typeint) of a scientist.
Write following functions for this class
- Constructor(bothparameterized and non-parameterized)
- Destructor
- Get (input from user) and Show (print) member functions for all data members.
- Imagine a manager class that stores the name (a string), age (type int) and salary (type float array to hold data of last five salaries) of a manager.
Write following functions for this class.
- Constructor(non-parameterized only)
- Destructor
- Get (input from user) and Show (print) member functions for all data members.
Test
- Writeamain ()programthatasks user how many scientist objects should be created.
- Based on user input, dynamically create the objects.
- Fill-up data-members values for each object using Get member function.
- Then ask user how many manager objects should be created.
- Create the objects and fill-up data-members in the same way as described earlier.
- Ask user to enter a salary (e.g., user enters 40,000, known as given salary)
- Write a functionhighsalaryto show the names of only those managers whose salary (any one out of five) is higher than the given salary
- Ask user whether output shall be written in a file. In case of yes,write data to a file in append mode
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started