Give me only code, No need to run Consider the following partial class declaration of an ADT: class Employee {friend ostream& operator<<(ostream& outs. const Employee & the_emp); //output name and salary with salary in the format Rxxx.xx public: Employee(string n, double sal); ~Employee(): void setSalary(double sal); string getName()const void raiseSalary(double percent); // raises an employee's //salary with the percentage specified by the argument percent private: string name: double salary: }; Use the appropriate member functions given in the partial class declaration for the class Employees to write statements to do the following: • Use the overloaded constructor to instantiate an object newEmployee of the class Employee with the name "Mpho Malebane" and a salary of R123 000. • Write a statement to check whether the object newEmployee is Mpho Malebane, and if so, raise his salary with 10%. • Use the overloaded stream insertion operator to display the name and salary of the newEmployee on the screen.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 6E
icon
Related questions
Question
Give me only code, No need to run
Consider the following partial class declaration of an ADT:
class Employee
{ friend ostream& operator << (ostream& outs.
const Employee & the_emp);
//output name and salary with salary in the format Rxxx.xxx
public:
Employee(string n., double sal);
~Employee():
void setSalary(double sal);
string getName() const
void raiseSalary(double percent); // raises an employee's //salary with the percentage specified
by the argument percent
private:
string name;
double salary:
};
Use the appropriate member functions given in the partial class declaration for the class
Employees to write statements to do the following:
• Use the overloaded constructor to instantiate an object newEmployee of the class
Employee with the name "Mpho Malebane" and a salary of R123 000.
•
Write a statement to check whether the object newEmployee is Mpho Malebane, and if
so, raise his salary with 10%.
•
Use the overloaded stream insertion operator to display the name and salary of the
newEmployee on the screen.
Transcribed Image Text:Give me only code, No need to run Consider the following partial class declaration of an ADT: class Employee { friend ostream& operator << (ostream& outs. const Employee & the_emp); //output name and salary with salary in the format Rxxx.xxx public: Employee(string n., double sal); ~Employee(): void setSalary(double sal); string getName() const void raiseSalary(double percent); // raises an employee's //salary with the percentage specified by the argument percent private: string name; double salary: }; Use the appropriate member functions given in the partial class declaration for the class Employees to write statements to do the following: • Use the overloaded constructor to instantiate an object newEmployee of the class Employee with the name "Mpho Malebane" and a salary of R123 000. • Write a statement to check whether the object newEmployee is Mpho Malebane, and if so, raise his salary with 10%. • Use the overloaded stream insertion operator to display the name and salary of the newEmployee on the screen.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning