Question: c++ program 2 Clerk A clerk is given by the following attributes: his Name and lastname (of type String) the year of birth (of type

c++ programc++ program 2 Clerk A clerk is given by the following attributes:

2 Clerk A clerk is given by the following attributes: his Name and lastname (of type String) the year of birth (of type int) his salary class (of type int) a boolean value that indicates whether the clerk is married The purpose of the assignment is to design a class for clerks and to find out his monthly salary given the information above. The monthly salary is calculated as follows: The base salary of 2000 Euro will be increased by x_17-9 Percent, where x is the salary class. Starting with the year, in which the clerk will be 30 years old, the calculated amount increases each 5 years by 1 Percent The allowance for married clerks is 12.3 percent from the base salary a) Define a class Clerk with the attributes defined above. b) Writea constructor Clerk(String firstName, String lastName, int yearOfBirth, int salaryClass, boolean married). This constructor has to initialise the instance variables of a clerk with the actual parameters c) Write a method void promote(int newSalaryClass) that will classify a clerk into a new salary class d) Augment your class with the methods void marry() and void divorce(), that change the marital status (married or not married) e) Write a method double salary(int thisYear) that calculates the salary. In the variable thisYear the year, in which the salary has to be calculated, will be stored. f) Write a method main that constructs two clerks and performs the following Display the salary of both clerks. The first clerk get married. Then display the salary of both clerks The second clerk change to the salary class 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!