Programming SBA Sample v2 - Copy
Programming SBA Sample v2 - Copy
Problem Statement
A program is required that prompts for employee number, job title and
hours worked. It then calculates the regular, overtime pay and total pay
based upon the various pay rates and it prints out employee numbers, job
titles, hours worked, regular pay, overtime pay and total pay.
IPO Chart
Algorithm
ALGORITHM PayrollCalculator
VARIABLES
EmployeeNumber, RateOfPay, counter As Integer
JobTitle As String
HrsWorked, RegularPay, OvertimePay, TotalPay As Real/Float/Double
BEGIN
1 HrsWorked = 0
2 RateOfPay = 0
3 RegularPay = 0
4 OvertimePay = 0
5 TotalPay = 0
6 FOR counter = 1 TO 12 DO
7 PRINT “Please enter Employee Number”
8 READ EmployeeNumber
1 READ JobTitle
0 PRINT “Please enter hours worked”
1
1 Read HrsWorked
1
2 IF JobTitle = ‘Manager’ THEN
1
3 RateOfPay = 100
1
4 ELSE IF JobTitle = ‘Accountant’ THEN
1
5 RateOfPay = 80
1
6 ELSE IF JobTitle = ‘Sales Representative’ THEN
1
7 RateOfPay = 50
1
8 ELSE IF JobTitle = ‘Courier Driver’ THEN
1
9 RateOfPay = 30
2
0 END IF
2
5
TotalPay = RegularPay + OvertimePay