Write a program that defines a class Employee with the following members as shown in the bellow UML diagram. 1) getAnnualSalary: Employee return the annual salary +name: string (f for the employee. +enpld: int 1monthsalary: double + ge LAanualsalary () :double addsalary (donbla): void + print (): void 2) addsalary: a void function that increases the salary of the employee by the parameter value. 3) Print: print the information for the employee In the main: 1) Declare 2 objects of type Employee (empl aud emp2). 2) Prompt the user to input 3 values to set the values ofempl. 3) Set the values ("Ali", "163878", 500) for emp2. 4) Print the annual salary for empl 5) Print the information of emp2 6) Prompt the user to enter a value then add it to the salary of emp2 (by calling the addSalary function). Then, prints the new price for emp2.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
100%
Use class in c++ Object-oriented
Write a program that defines a class Employce with the following members as
shown in the bellow UML diagram.
1) getAnnualSalary:
return the annual salary
Employee
+name: string
(f )for the employee. +epld: int
+monthsalary: double
+ ge LAnnualsalary () :double
+ addsalary (donble): void
+ print (): void
2) addsalary: a void function
that increases the salary of
the employee by the
parameter value.
3) Print: print the information
for the employee
In the main:
1) Declare 2 objects of type Employee (empl and emp2).
2) Prompt the user to input 3 values to set the values of empl.
3) Set the values ("Ali", "163878", 500) for emp2.
4) Print the annual salary for empl
5) Print the information of emp2
6) Prompt the user to enter a value then add it to the salary of emp2 (by calling
the addSalary function). Then, prints the new price for emp2.
Transcribed Image Text:Write a program that defines a class Employce with the following members as shown in the bellow UML diagram. 1) getAnnualSalary: return the annual salary Employee +name: string (f )for the employee. +epld: int +monthsalary: double + ge LAnnualsalary () :double + addsalary (donble): void + print (): void 2) addsalary: a void function that increases the salary of the employee by the parameter value. 3) Print: print the information for the employee In the main: 1) Declare 2 objects of type Employee (empl and emp2). 2) Prompt the user to input 3 values to set the values of empl. 3) Set the values ("Ali", "163878", 500) for emp2. 4) Print the annual salary for empl 5) Print the information of emp2 6) Prompt the user to enter a value then add it to the salary of emp2 (by calling the addSalary function). Then, prints the new price for emp2.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Keywords
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr