Need a Program in OOP C++ using function over loading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sergio281
    New Member
    • Dec 2021
    • 1

    Need a Program in OOP C++ using function over loading

    Q.No.1: A company pays its employees on a weekly basis. The employees are of two types:
    1. Salaried Employees 2. Hourly Employees
    Salaried employees are paid with a fixed weekly salary, regardless of the number of hours they worked.
    Fix week salary
    is
    2000 / w
    Hourly employees are paid by the hour and receive overtime pay for all hours worked in excess of 40 hours. If they work less than 40 hours then their salary will be:
    Salary = wage*hours
    If they work more than 40 hours their salary will be calculated using the given formula:
    Salary = (40*wage) +((hours-40)*wage*1.5)
    Where wage per hour will be 400 PKR.
    The company wants to implement a C++ program that performs its payroll calculations. You are required to write C++ program to implement the above mentioned concept using function overloading.
    Sample output
    Please enter employee status
    Hourly Employee
    Please enter work hours:
    :
    30
    Your total salary is
    12000
    Following class diagram can help you to understand the class structure
    Class Employee
    Salaried Employees Hourly Employees Working Hours wage Salary
    +Comput_salay()

    It's Ugrent Please
  • dev7060
    Recognized Expert Contributor
    • Mar 2017
    • 656

    #2
    Q.No.1: A company pays its employees on a weekly basis. The employees are of two types:
    1. Salaried Employees 2. Hourly Employees
    Salaried employees are paid with a fixed weekly salary, regardless of the number of hours they worked.
    Fix week salary
    is
    2000 / w
    Hourly employees are paid by the hour and receive overtime pay for all hours worked in excess of 40 hours. If they work less than 40 hours then their salary will be:
    Salary = wage*hours
    If they work more than 40 hours their salary will be calculated using the given formula:
    Salary = (40*wage) +((hours-40)*wage*1.5)
    Where wage per hour will be 400 PKR.
    The company wants to implement a C++ program that performs its payroll calculations. You are required to write C++ program to implement the above mentioned concept using function overloading.
    Sample output
    Please enter employee status
    Hourly Employee
    Please enter work hours:
    :
    30
    Your total salary is
    12000
    Following class diagram can help you to understand the class structure
    Class Employee
    Salaried Employees Hourly Employees Working Hours wage Salary
    +Comput_salay()
    You're going to need to write some code for this.

    Comment

    Working...