Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Define hormone.

Answered: 1 week ago

Question

Identify the variables that affect the reorganization design.

Answered: 1 week ago