Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

Name: Ismaria binti Ismail

NIC: 800812-12-0872

Category: A1

Total Hours: 46

Syarikat Smart Store Hypermarket Sdn. Bhd.

============================================================

Name: Ismaria binti Ismail

NIC: 800812-12-0872

Category: A1

Total Hours: 46

Gross Pay: RM 220.00

Overtime Pay: RM 5.00

Net Pay: RM 225.00

Continue (Y/N) ? : Y

Name: Shamsul Bahri bin Ahmad

NIC: 800611-01-0719

Category: A2

Total Hours: 62

INPUT NOT VALID!!

Continue (Y/N)? : N

Based on the above programming problem:

  1. Analyse the problem to identify required items to be used in designing algorithm
  2. Write an algorithm in a pseudo code
    1. 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.

  3. Draw a flowchart based on the pseudo code
  4. Produce a tracing table to show the projected values

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Window Functions For Data Analysis And Beyond

Authors: Itzik Ben Gan

2nd Edition

0135861446, 978-0135861448

More Books

Students also viewed these Databases questions