Question
Please answer part I, iii and iv Syarikat Smart Store Hypermarket Sdn. Bhd. wants to create a system that will calculate the weekly pay for
Please answer part I, iii and iv
Syarikat Smart Store Hypermarket Sdn. Bhd. wants to create a system that will calculate the weekly pay for its employees, based on the category and rate given in the table below. The employees in the category A1, A2 and M1 are paid standard rate for the first 44 hours, followed by 1.5 the standard rate for overtime pay. There is no overtime pay for M2 and BB categories. The total work hours for each employee cannot exceed 60 hours.
The system should request for the employees name, their IC number, the number of hours worked, and their category. The system should display all related information about the employee including the gross pay, overtime pay and the net pay.
Category | Standard Rate: Pay/Hour |
A1 | RM 5 |
A2 | RM 7 |
M1 | RM 10 |
M2 | RM 15 |
BB | RM 20 |
Here is a sample of a programs interface dialog:
|
Based on the above programming problem:
- Analyse the problem to identify required items to be used in designing algorithm
- Write an algorithm in a pseudo code
-
The algorithm for the scenario is below -
Set Continue for Employees to 'Y'
Repeat until Continue is set to 'N'.
Input the name, NIC number, Category and Number of Hours worked per week.
while Number of Hours worked is less than or equal to 60 repeat below steps -
if Category is M2, gross pay is 44 multiplied by rm 15. net pay is equal to gross pay. overtime pay is zero else
if Category is BB, gross pay is 44 multiplied by rm 20. net pay is equal to gross pay. overtime pay is zero else
if Category is A1, gross pay is 44 multiplied by rm 5. if number of hours worked is >44, overtime hours will be number of hours worked - 44. overtime pay is overtime hours multiplied by 5*1.5. net pay is gross pay + overtime pay.
if Category is A2, gross pay is 44 multiplied by rm 7. if number of hours worked is >44, overtime hours will be number of hours worked - 44. overtime pay is overtime hours multiplied by 7*1.5. net pay is gross pay + overtime pay.
if Category is M1, gross pay is 44 multiplied by rm 10. if number of hours worked is >44, overtime hours will be number of hours worked - 44. overtime pay is overtime hours multiplied by 7*1.5. net pay is gross pay + overtime pay.
Display Name, NIC Number, Category, Number of Hours Worked, Gross Pay, Overtime Pay and Net Pay.
Input continue value.
-
- Draw a flowchart based on the pseudo code
- Produce a tracing table to show the projected values
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started