Skip to content

Prompt 2 solution #3

@Josure-github-page

Description

@Josure-github-page

ICG PROJECT
Prompt 2:
Ayesha Beauty Creation has human resource department like employees who responsible for running the business activities. Labors are shared among employees like some are on production of products, some are on sales and marketing and some are delivering products to customers.
Employees are paid depending on the hours they worked. If the hours worked are less than or equal to 45 it’s normal hours and the normal HoursWorked amount is N$40.50 per hour. If the hours exceeded 45 than it’s overtime hours and the overtime HoursWorked amount is N$55.00 per overtime hours.
Following is the program that calculate and display employee’s weekly salary

Start

  1. Prompt for HoursWorked
  2. Get HoursWorked
  3. Normal HoursWorked = HoursWorked – Overtime HoursWorked
  4. Get normal HoursWorked
  5. If HoursWorked = 45 per day, then weekly salary = normal HoursWorked × normal HoursWorked amount
  6. Get the weekly salary
  7. If else HoursWorked > 45 per day then overtime HoursWorked = total HoursWorked – normal HoursWorked
  8. Get overtime HoursWorked
  9. Overtime HoursWorked total amount = overtime HoursWorked × overtime HoursWorked amount
  10. Get overtime HoursWorked total amount
  11. Normal HoursWorked amount = normal HoursWorked × normal HoursWorked amount
  12. Get the normal HoursWorked total amount
  13. Weekly salary = overtime HoursWorked total amount + normal HoursWorked total amount
    End if
  14. Get weekly salary
    End
    Josure Amunyela is an employee at Ayesha Beauty Creation and he worked for 48 and he got paid N$ 55.00 for overtime HoursWorked per day and N$ 40.50 for normal HoursWorked per day. Write a program that calculate a weekly salary. Give weekly salary as the output.
    Total HoursWorked = 48 hours
    Normal HoursWorked = 45 hours
    Overtime HoursWorked = 3 hours
    Normal HoursWorked amount = N$ 1822.50
    Overtime HoursWorked amount = N$ 165.00
    Weekly salary = N$ 1987.50 Expected output

START

  1. Prompt for total HoursWorked
  2. 48 hours
  3. Normal HoursWorked = 48 hours – 3 hours
  4. Get 45 hours
  5. If total HoursWorked = 45 then, weekly salary = 45hours × N$ 40.50
  6. Get N$ 1822.50
  7. If else HoursWorked > 45 then, overtime HoursWorked = 48 hours – 45 hours
  8. Get 3 hours
  9. Overtime HoursWorked amount = 3 hours × N$ 55.00
  10. Get N$ 165.00
  11. Normal HoursWorked amount = 45 hours × N$ 40.50
  12. Get N$ 1822.50
  13. Weekly salary = N$ 1822.50 + N$ 165.00
    End if
  14. Get N$ 1987.50
    END

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions