Вы находитесь на странице: 1из 9

BACHELOR OF INFORMATION TECHNOLOGY WITH HONOURS (BIT)

SEMESTER 1 / YEAR 2019

CBCP2101

COMPUTER PROGRAMMING I

MATRICULATION NO:
IDENTITY CARD NO. :
TELEPHONE NO. :
E-MAIL :
LEARNING CENTRE : OUM ALOR SETAR

0
Contents
1. Analyses ---------------------------------------------------------------------------------------------------------------- 2
1. Pseudocode -------------------------------------------------------------------------------------------------------------- 3-4
2. Flowchart ----------------------------------------------------------------------------------------------------------------- 5-6
3. Tracing table ------------------------------------------------------------------------------------------------------------- 7-8
4. References ---------------------------------------------------------------------------------------------------------------- 9

1
i. Analyse

INPUT PROCESS OUTPUT


1. Employee’s_Name 1. Gross_Pay = Standard_Hours * 1. Employee’s_Name
2. IC_Number 2. IC_Number
Standard_Rate
3. Category 3. Category
2. Overtime_Pay = Overtime_Hours *
4. Total_Hours_Works 4. Total_Hours_Works
Standard_Rate * Overtime_Rate 5. Gross_Pay
3. Net_ Pay = Gross_Pay + Overtime_Pay 6. Overtime_Pay
7. Net_ Pay

2
ii. Pseudocode

1.0 Start
2.0 SET continue as ‘y’
3.0 Until continue == ‘y’
4.0 Start
4.1 SET Standard_Hours = 44
4.2 Input Employee’s_Name
4.3 Input IC_Number
4.4 Input Category
4.5 Input Total_Hours_Works
4.6 If (Category = A1)
4.7 Start
4.7.1 SET Standard Rate = 5
4.8 End_If1
4.9 If_Not
4.10 If (Category = A2)
4.11 Start
4.11.1 SET Standard Rate = 7
4.12 End_If2
4.13 If_Not
4.14 If (Category = M1)
4.15 Start
4.15.1 SET Standard Rate = 10
4.16 End_If3
4.17 If_Not
4.18 If (Category = M2)
4.19 Start
4.19.1 SET Standard Rate = 15
4.20 End_If4
4.21 If_Not
4.22 If (Category = BB)
4.23 Start
4.23.1 SET Standard Rate = 20
4.24 End_If5
4.25 If_Not
4.26 Start
4.26.1 Print “INPUT NOT VALID!!”
4.26.2 Input Continue ( Y / N ) ? :
4.27 End_If_Not
4.28 If (Total_Hours_Works > 60)
4.29 Start_If
4.29.1 Print Employee’s_Name, IC_Number, Category, Total_Hours_Works,
4.29.2 Print “INPUT NOT VALID !!”
4.29.3 Input Continue ( Y / N ) ? :
4.30 End_If
4.31 If (Category != M2 & BB)
4.32 Start_If
4.32.1 SET Overtime_Rate = 1.5
4.32.2 SET Overtime_Hours = Total_Hours_Works – Standard_Hours
4.32.3 SET Gross_Pay = Standard_Hours * Standard_Rate
4.32.4 SET Overtime_Pay = Overtime_Hours * Standard_Rate * Overtime_Rate
4.32.5 SET Net_ Pay = Gross_Pay + Overtime_Pay
3
4.33 End_If
4.34 If_Not
4.35 Start
4.35.1 SET Gross_Pay = Standard_Hours * Standard_Rate
4.35.2 SET Overtime_Pay = 0
4.35.3 SET Net_ Pay = Gross_Pay
4.36 End_If_Not
4.37 Print Employee’s_Name, IC_Number, Category, Total_Hours_Works
4.38 Print Gross_Pay
4.39 Print Overtime_Pay
4.40 Print Net_Pay
4.41 Input Continue ( Y / N ) ? :
5.0 End
6.0 End

4
iii. Flowchart

START

SET continue as ‘y’,


Standard_Hours = 44

INPUT Employee’s_Name,
IC_Number, Category,
Total_Hours_Works

Categor YES
SET Standard Rate = 5
y = A1

NO
YES
Categor
y = A2 SET Standard Rate = 7

NO
YES
Categor
SET Standard Rate = 10
y = M1

NO
YES
Categor SET Standard Rate = 15
y = M2

YES NO
NO Categor YES
Print “INPUT NOT SET Standard Rate = 20
VALID!!” y = BB

Input Continue ( Y / N ) ? :
YES

NO Print Employee’s_Name,
Total_Hou YES
rs_Works IC_Number, Category,
> 60 Total_Hours_Works,
“INPUT NOT VALID!!”

NO
Input Continue ( Y / N ) ? :

NO 4
1 2 5
3
2
1 3

Categor 4
NO YES
SET Gross_Pay = y !=
Standard_Hours * M2 &
Standard_Rate, BB SET Overtime_Rate = 1.5,
Overtime_Pay = 0, Overtime_Hours =
Net_ Pay = Gross_Pay Total_Hours_Works –
Standard_Hours,
Gross_Pay =
Standard_Hours *
Standard_Rate,
Overtime_Pay =
Overtime_Hours *
Standard_Rate *
Overtime_Rate,
Net_ Pay = Gross_Pay +
Overtime_Pay

Print
Employee’s_Name,
IC_Number,
Category,
Total_Hours_Works,
Gross_Pay,
Overtime_Pay,
Net_Pay

YES
Input Continue ( Y / N ) ? :

NO

END

6
Tracing table
Shamsul Bahri bin
EMPLOYEE NAME Ismaria binti Ismail Tan Su Xiu Lee Tian Sheng Liu Xuan En
Ahmad
IC NUMBER 800812-12-0872 800611-01-0719 800713-03-0632 800115-02-5113 800511-02-5916
CATEGORY A1 A2 M1 M2 BB
TOTAL HOURS WORK 46 58 49 44 44
STANDARD_RATE RM 5 RM 7 RM 10 RM 15 RM 20
OVERTIME_RATE RM 1.5 RM 1.5 RM 1.5 - -
OVERTIME_HOURS =
TOTAL_HOURS_WORKS – 2 14 5 0 0
STANDARD_HOURS
GROSS_PAY = STANDARD_HOURS
RM 220 RM 308 RM 440 RM 660 RM 880
* STANDARD_RATE
OVERTIME_PAY =
OVERTIME_HOURS *
RM 15 RM 147 RM 75 0 0
STANDARD_RATE *
OVERTIME_RATE
NET_ PAY = GROSS_PAY +
RM 235 RM 455 RM 515 RM 660 RM 880
OVERTIME_PAY
Shamsul Bahri bin
EMPLOYEE’S_NAME Ismaria binti Ismail Tan Su Xiu Lee Tian Sheng Liu Xuan En
Ahmad
IC_NUMBER 800812-12-0872 800611-01-0719 800713-03-0632 800115-02-5113 800511-02-5916
CATEGORY A1 A2 M1 M2 BB
TOTAL_HOURS_WORKS 46 58 49 44 44
GROSS_PAY RM 220 RM 308 RM 440 RM 660 RM 880
OVERTIME_PAY RM 15 RM 147 RM 75 0 0
NET_ PAY RM 235 RM 455 RM 515 RM 660 RM 880

7
REFERENCES

Marini, A.B, Dr, Sufian. I, Nor, L.J, Roziah, L, (2014). Faculty of Science and Technology, CBCP2101

Computer Programming 1, Open University Malaysia