Professional Documents
Culture Documents
1
Table of Contents
TOPICS PAGES
2
ACTIVITY 1: Introduction of Programming Language
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 1.1, 1.2, 1.3, 1.4, 1.5 and 1.6
CASE STUDY
Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of
managing Human Resources (HR) data. The automation involves the staff details, staff payroll
and etc. En. Muhammed wants to hire an IT Programmer to develop a system. He draft a sets
of questions to test the general IT and programming knowledge of a new programmer.
INSTRUCTION:
1. You are one of the candidate for post IT Programmer, Infinity Design Solution Sdn. Bhd.
2. Answer the entire questions below.
Activity 1.1
Activity Outcome: Identify the programming language generation based on the figures given.
Duration : 10 minutes
Look carefully at the images given. The images uniquely represent each programming language
generation that you have learned. Can you identify and match the programming language
generation correctly?
Features
Features
Features
3
Activity 1.2
Activity Outcome: Distinguish between the various language translators.
Duration : 20 minutes
Determine the language translator, X and Y in figure below and state TWO (2) of their
advantages and disadvantages.
X Y
Advantages
Disadvantages
Advantages
Disadvantages
4
Activity 1.3
Activity Outcome: Determine the lifecycle of a software project phases.
Duration : 20 minutes
Re arrange the phases in software project life cycle. Explain activities and task performs by
project team during each phase.
Activity 1.4
Activity Outcome: Determine standards and best practices in writing program codes
Duration : 20 minutes
5
Activity 1.5
Activity Outcome: Determine programming languages application in real life.
Duration : 30 minutes
6
Activity 1.6
Activity Outcome: Determine programming languages application in real life.
Duration : 20 minutes
Discuss and list examples of suitable application which implements programming in real life
application in each field.
Medical
1. _________________________________
2. _________________________________
3. _________________________________
1. _________________________________
2. _________________________________
3. _________________________________
Education
on Agricultural
1. _________________________________
2. _________________________________
3. _________________________________
7
ACTIVITY 2A: Problem Solving Methods
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 2A.1, 2A.2, 2A.3, 2A.4, 2A.5 and 2A.6
CASE STUDY
Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of
managing Human Resources (HR) data. Cik Suria was selected to be an IT programmer for
Infinity Design Solution. En. Mohamed insist to develop a system to manage staff payroll. Cik
Suria has to prepare a proposal for payroll system.
INSTRUCTION:
1. You have been assigned to help Cik Suria to prepare a proposal which include:
Decide a proper title for the system
Elaborate a system introduction
State the problem statements
Identify an objective
Explain the phases in Programming Life Cycle (PLC) with examples.
a. Specify the problem
b. Analyze the problem
c. Design the algorithm to solve the problem
d. Implement the algorithm
e. Test and verify the completed program
f. Maintain and update the program
g. Documentation
Activity 2A.1
Activity Outcome: Decide a proper title for the system
Duration : 10 minutes
8
Activity 2A.2
Activity Outcome: Elaborate a system introduction
Duration : 20 minutes
System introduction:
Activity 2A.3
Activity Outcome: State the problem statements
Duration : 20 minutes
Problem statements:
1.
2.
3.
Activity 2A.4
Activity Outcome: Identify an objective
Duration : 20 minutes
Objectives:
1.
2.
3.
9
Activity 2A.5
Activity Outcome: Explain the phases in Programming Life Cycle (PLC) with examples.
Duration : 25 minutes
Cik Suria asks you to prepare the planning for system development. You have to study the
phases and activities involves in program life cycle. Define the phase definition below to match
the Description with its appropriate Phase by using line in the space provided.
No Description No Phase
Run the program several times using different
1 sets of data Implementation
10
• manage staff payroll
Case Scenario • (program life cycle)
Activity 2A.6
Activity Outcome: Relate the PLC with the life cycle of a Software Project.
Duration : 25 minutes
Based on scenario below, plan phase and activity that involved in Software Development
Method.
PAYROLL SYSTEM
1. Infinity Design Solution Sdn. Bhd. stores the data for employee payroll in file
system. The calculations for payroll are done manually by the clerk.
2. IT Department want to automate the process of payroll calculation by develop
a small application.
3. Programmer will save all data in the database and test whether the system can
calculate the payroll for the employees automatically.
4. Then, the new systems will be tested. The net salary for the employees will be
display and function well
5. All data in file system will transfer into computerized system for easy searching
and data updating.
No Phase Activities
2 Analyzing
4 Implementation
7 Documentation
11
ACTIVITY 2B: Problem Solving Methods
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 2B.1, 2B.2, 2B.3, 2B.4 and 2B.5
CASE STUDY
Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of
managing Human Resources (HR) data. Cik Suria was selected to be an IT programmer for
Infinity Design Solution. En. Mohamed insist to develop a system to manage staff payroll. Cik
Suria has to prepare a proposal for payroll system.
INSTRUCTION:
1. You have been assigned to help Cik Suria to prepare a proposal which include:
System analysis (define input, process and output)
Create a complete IPO chart
Activity 2B.1
Activity Outcome: System analysis (define input, process and output )
Duration : 20 minutes
You try to find out some exercises to identify input, process and output from real life application
as below:
Problem 1:
Below is the set of work flows of Auto Pay Machine for Parking Ticket. Select the appropriate
instruction to be place in the correct box by categorizing them into input, process and output
instructions. Highlight / underline your answer.
Set of Instructions:
1) Insert parking ticket ( input / process / output )
2) The payment will be calculated based on the duration ( input / process / output )
3) Parking fee will be displayed ( input / process / output )
4) Pay by notes or coins ( input / process / output )
5) Calculate the change for payment balance ( input / process / output )
6) Processed parking ticket ( input / process / output )
7) Verify amount of money inserted ( input / process / output )
12
Problem 2:
Below is the set of work flows of Course Registration for student. Select the appropriate instruction
to be place in the correct box by categorizing them into input, process and output instructions.
Highlight / underline your answer.
Set of Instructions:
1) Save selected class for course registration in the database ( input / process / output )
2) Course registration slip display at the screen ( input / process / output )
3) Select course for registration ( input / process / output )
4) Printed course registration slip ( input / process / output )
5) Enter your ID and password ( input / process / output )
6) System will validate your ID and password ( input / process / output )
7) Select the class that offer the course selected before ( input / process / output )
8) Save selected course registration in the database ( input / process / output )
Activity 2B.2
Activity Outcome: System analysis (Identify input, process and output)
Duration : 45 minutes
You do some research on defining input, process and output for certain problem as examples
below:
You try some exercise to get more understanding about defining input, process and output as
below:
Problem 1: Input:
To buy the books from the book shop,
cashier will scan the price of the books and
quantity of the book. Then the system will
calculate the total price of the books. Process :
Output :
13
Problem 2: Input:
Aiman wants to know his BMI. His weight is
calculated in kilogram and height is
calculated in meter. Help Aiman to find his Process :
BMI.
Output :
Problem 3: Input:
To rent a video, customer need to scan the
video serial number at our shop scanner
and the details of the video will be save in Process :
the system automatically. Next, the scanner
will print out the details about the video
rental. Lastly, the customer needs to go to
counter and pay for the rental fee. Output :
Problem 4: Input:
Every employee needs to thumb their
fingerprint everyday as proof of their daily
attendance to the work. Then the Process :
attendance system will save the employee
information such as name, time and date.
The information can be printed out at the
end of the month. Output :
Problem 5: Input:
Create a receipt for a list of five (5)
purchased items. Print the total price,
compute the total with 8.25% tax and print Process :
the money tendered (plus any change
given).
Output :
Problem 6: Input:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a
program that can count the total rate by Process :
multiply room rate with number of days,
and add 10% room service charges. Draw
the flowchart by using the problem analysis
below.
Output :
14
Problem 7: Input:
Mr Wong is a mathematics teacher. He
wants to teach his students about how to
convert time in hour into the times in Process :
minute. Help Mr Wong to solve his problem.
Output :
Activity 2B.3
Activity Outcome: System analysis (Identify input, process and output )
Duration : 15 minutes
Define input, process and output for module manage staff payroll.
Output :
15
Activity 2B.4
Activity Outcome: create a complete IPO chart
Duration : 25 minutes
Cik Suria wants you to summarize your input, process and output into IPO chart. You do some
research on IPO chart as examples below:
IPO chart:
IPO chart :
You try some exercise to get more understanding about IPO chart as below:
Problem 2:
Aiman wants to know his BMI. His
weight is calculated in kilogram
and height is calculated in meter.
Help Aiman to find his BMI.
16
Problem 3:
Mr Wong is a mathematics
teacher. He wants to teach his
students about how to convert
time in hour into the times in
minute. Help Mr Wong to solve his
problem.
Activity 2B.5
Activity Outcome: create a complete IPO chart
Duration : 15 minutes
Case Senario:
The system will automate the process of calculate payroll for employees worked at
Infinity Design Solution Sdn. Bhd. Each employee will be recognized by employee ID.
The system will receive basic salary, allowance, overtime, income tax and loan
deduction. The system will automatically calculate the gross salary, total deduction
and net salary for the employee.
IPO chart :
17
ACTIVITY 2C: Problem Solving Methods
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 2C.1, 2C.2 and 2C.3
CASE STUDY
Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of
managing Human Resources (HR) data. Cik Suria was selected to be an IT programmer for
Infinity Design Solution. En. Mohamed insist to develop a system to manage staff payroll. Cik
Suria has to prepare a proposal for payroll system.
INSTRUCTION:
1. You have been assigned to help Cik Suria to prepare a proposal which include:
System design (algorithm and pseudo code )
Activity 2C.1
Activity Outcome: System design (algorithm and pseudo code )
Duration : 50 minutes
Cik Suria ask you to proceed with system design. You have to write an algorithm for problem
analysis created before. You do some research on algorithm as examples below:
18
You try some exercise to get more understanding about algorithm as below:
PROBLEM ALGORITHM
Problem 1:
To buy the books from the book shop,
cashier will scan the price of the books and
quantity of the book. Then the system will
calculate the total price of the books.
Problem 2:
Aiman wants to know his BMI. His weight is
calculated in kilogram and height is
calculated in meter. Help Aiman to find his
BMI.
Problem 3:
To rent a video, customer need to scan the
video serial number at our shop scanner
and the details of the video will be save in
the system automatically. Next, the scanner
will print out the details about the video
rental. Lastly, the customer needs to go to
counter and pay for the rental fee.
Problem 4:
Every employee needs to thumb their
fingerprint everyday as proof of their daily
attendance to the work. Then the
attendance system will save the employee
information such as name, time and date.
The information can be printed out at the
end of the month.
Problem 5:
Create a receipt for a list of five (5)
purchased items. Print the total price,
compute the total with 8.25% tax and print
the money tendered (plus any change
given).
Problem 6:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a
program that can count the total rate by
multiply room rate with number of days,
and add 10% room service charges. Draw
the flowchart by using the problem analysis
below.
19
Problem 7:
Mr Wong is a mathematics teacher. He
wants to teach his students about how to
convert time in hour into the times in
minute. Help Mr Wong to solve his problem.
Problem 8:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a
program that can count the total rate by
multiply room rate with number of days,
and add 10% room service charges. Draw
the flowchart by using the problem analysis
below.
Activity 2C.2
Activity Outcome: System design (algorithm and pseudocode )
Duration : 50 minutes
After study about algorithm, Cik Suria wants you to you do some research on writing pseudo
code.
PROBLEM PROBLEM ANALYSIS PROBLEM DESIGN (PSEUDO CODE)
Problem 1: Input: 3 numbers Start
Calculate total of three Process : Calculate total Enter 3 number (num1, num2, num3)
numbers of three numbers by add Calculate total of three numbers
all 3 numbers Total of three numbers = num1 +
Output : total of three num2 + num3
numbers Display total of three numbers
End
Problem 2: Input: birth year, current Start
Calculate age year Enter birth year, current year
Process : Calculate age Calculate age
by current year deduct age = current year – birth year
birth year Display age
Output : age End
You try some exercise to get more understanding about pseudo code as below:
20
Problem 2:
Aiman wants to know his BMI. His weight is
calculated in kilogram and height is
calculated in meter. Help Aiman to find his
BMI.
Problem 3:
To rent a video, customer need to scan the
video serial number at our shop scanner
and the details of the video will be save in
the system automatically. Next, the scanner
will print out the details about the video
rental. Lastly, the customer needs to go to
counter and pay for the rental fee.
Problem 4:
Every employee needs to thumb their
fingerprint everyday as proof of their daily
attendance to the work. Then the
attendance system will save the employee
information such as name, time and date.
The information can be printed out at the
end of the month.
Problem 5:
Create a receipt for a list of five (5)
purchased items. Print the total price,
compute the total with 8.25% tax and print
the money tendered (plus any change
given).
Problem 6:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a
program that can count the total rate by
multiply room rate with number of days,
and add 10% room service charges. Draw
the flowchart by using the problem analysis
below.
21
Problem 7:
Mr Wong is a mathematics teacher. He
wants to teach his students about how to
convert time in hour into the times in
minute. Help Mr Wong to solve his problem.
Problem 8:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a
program that can count the total rate by
multiply room rate with number of days,
and add 10% room service charges. Draw
the flowchart by using the problem analysis
below.
Activity 2C.3
Activity Outcome: System design (algorithm and pseudocode )
Duration : 20 minutes
Define algorithm and pseudo code for module manage staff payroll.
PROBLEM
Case Senario:
The system will automate the process of calculate payroll for employees worked at Infinity Design
Solution Sdn. Bhd. Each employee will be recognized by employee ID. The system will receive gross
income, allowance, overtime, income tax and loan deduction. The system will automatically
calculate the total income, total deduction and net salary for the employee.
22
ACTIVITY 2D: Problem Solving Methods
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 2D.1, 2D.2, 2D.3 and 2D.4
CASE STUDY
Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of
managing Human Resources (HR) data. Cik Suria was selected to be an IT programmer for
Infinity Design Solution. En. Mohamed insist to develop a system to manage staff payroll. Cik
Suria has to prepare a proposal for payroll system.
INSTRUCTION:
1. You have been assigned to help Cik Suria to prepare a proposal which include:
System design (flow chart )
Activity 2D.1
Activity Outcome: System design (flow chart )
Duration : 30 minutes
Cik Suria propose the algorithm and pseudo En. Muhammed. En. Muhammed wants to convert
the algorithm or pseudo code into flow chart. Cik Suria ask you to proceed with system design
and try to convert algorithm and pseudo code into flow chart. You do some research on flow
chart as examples below:
PROBLEM DESIGN
PROBLEM PROBLEM DESIGN (FLOW CHART)
(ALGORITHM)
Problem 1: 1. Enter 3 numbers
Calculate total 2. Calculate total of three Start
of three numbers
numbers 3. Display total of three
numbers num1, num2, num3
display total
End
23
Problem 2: 1. Enter birth year, current
Calculate age year
Start
2. Calculate age
2.1 (current year – birth
year) as age birth year, current year
3. Display age
display age
End
You try some exercise to get more understanding about algorithm as below:
Problem 2:
Aiman wants to know his BMI. His weight is
calculated in kilogram and height is
calculated in meter. Help Aiman to find his
BMI.
24
Problem 3:
To rent a video, customer need to scan the
video serial number at our shop scanner
and the details of the video will be save in
the system automatically. Next, the scanner
will print out the details about the video
rental. Lastly, the customer needs to go to
counter and pay for the rental fee.
Problem 4:
Every employee needs to thumb their
fingerprint everyday as proof of their daily
attendance to the work. Then the
attendance system will save the employee
information such as name, time and date.
The information can be printed out at the
end of the month.
25
Problem 5:
Create a receipt for a list of five (5)
purchased items. Print the total price,
compute the total with 8.25% tax and print
the money tendered (plus any change
given).
Problem 6:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a
program that can count the total rate by
multiply room rate with number of days,
and add 10% room service charges. Draw
the flowchart by using the problem analysis
below.
26
Problem 7:
Mr Wong is a mathematics teacher. He
wants to teach his students about how to
convert time in hour into the times in
minute. Help Mr Wong to solve his problem
by construct a flowchart.
Problem 8:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a
program that can count the total rate by
multiply room rate with number of days,
and add 10% room service charges. Draw
the flowchart by using the problem analysis
below.
27
Activity 2D.2
Activity Outcome: System design (algorithm, pseudo code and flow chart )
Duration : 30 minutes
After study about algorithm, Cik Suria wants you to you do some exercise on converting
between algorithm, pseudo code and flow chart.
1) Input meter
2) Convert meter to kilometer
2.1) kilometer = meter * 1000
3) Display kilometer
28
FLOW CHART PSEUDO CODE
START
Set Total = 0, Average = 0;
Input quiz1, quiz2, quiz3;
Calculate Total
Total = quiz1 + quiz2 + quiz3;
Calculate Average
Average = Total / 3;
Display Average;
END
START
Input
item_price
END
29
• manage staff payroll
Case Scenario • (define input, process, output)
Activity 2D.3
Activity Outcome: System design (flow chart )
Duration : 15 minutes
PROBLEM
Case Senario:
The system will automate the process of calculate payroll for employees worked at Infinity Design
Solution Sdn. Bhd. Each employee will be recognized by employee ID. The system will receive gross
income, allowance, overtime, income tax and loan deduction. The system will automatically
calculate the total income, total deduction and net salary for the employee.
FLOW CHART
30
Activity 2D.4
Activity Outcome: Develop flowchart using problem solving tools (Raptor).
Duration : 45 minutes
Cik Suria just realizes that instead of using Microsoft Word to develop flow chart, you can use
Raptor tools to develop flow chart more easily. You do some research on Raptor tools and try to
develop all flow chart in Lab 2D.1, 2D.2 and 2D.3 by using Raptor tools.
31
ACTIVITY 3A: Fundamentals of Programming Language
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 3A.1, 3A.2, 3A.3, 3A.4 and 3A.5
CASE STUDY
Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of
managing Human Resources (HR) data. Cik Suria was selected to be an IT programmer for
Infinity Design Solution. En. Mohamed insist to develop a system to manage staff payroll. Cik
Suria has to prepare a proposal for payroll system.
INSTRUCTION:
1. Define the appropriate data type for each input, process and output.
2. Define proper correct naming convention for identifier.
Activity 3A.1
Activity Outcome: Identify the data type for the expression below.
Duration : 20 minutes
Based on expression below, you are required to determine the data type for each expression
below:
1 Number123
2 2016
3 -0.000000001
4 0.741
5 X
6 $
7 173.00
8 ()
9 grade
10 123456
32
Activity 3A.2
Activity Outcome: Identify the variables and data type based on the problems.
Duration : 25 minutes
Based on the problem given, writes the suitable variable and data type.
2. Age can be calculated based on the birth year and the current year. State the suitable
variable and the data type to complete the calculation.
3. You are creating a simple program to identify if a student passed or fail for their marks in the
mid semester test. State the suitable variable and data type to complete the program.
4. A shopping mall is currently having a sale for the coming festive season. All groceries item will
be given 20% discount and all clothing item will be given 15% discount. State the suitable
variable and the correct data type to calculate the discounted price for all items bought in
the shopping mall.
33
5. A simple program is created to store personal data of an employee. The information that
needs to be store includes full name, phone number and employee number. State the
suitable variable and data type to complete the program.
Activity 3A.3
Activity Outcome: Understand identifier, variable, constant and reserved words.
Duration : 20 minutes
1. Give the meaning of variable and constant and briefly explain the different between
variable and constant?
Variable Constant
1 break
2 number
3 return
4 braces
5 void
6 while
7 word
8 if
9 continue
10 int
34
3. Explain the function of the following terms and include 1 example of usage in C++
programming.
const
true
and
return
Activity 3A.4
Activity Outcome: Understand how to write the correct rules of naming identifier.
Duration : 25 minutes
1. Which of the following variables, identify valid or invalid? If invalid, give the reason.
1 Age
2 !ex
3 R79J
4 TotalIncome
5 _invalid
6 #validhashtag
7 100student
8 my_polytechnic
9 ILike Reading
10 num,ber1
35
2. State “TRUE” or “FALSE” for each of the variables declaration below.
int class;
1
float price$;
2
int &studentName;
3
char %discountRate;
4
int _ICnumber;
6
char 4saleItem;
7
int register;
8
char switch;
9
int enum;
10
36
• Define data type for each input, process,
Case Scenario output
• Correct naming conventions for identifier.
Activity 3A.5
Activity Outcome: System design (variable and data type )
Duration : 30 minutes
Define the correct variable and data type for module manage staff payroll.
PROBLEM
Case Senario:
The system will automate the process of calculate payroll for employees worked at Infinity Design
Solution Sdn. Bhd. Each employee will be recognized by employee ID. The system will receive gross
income, allowance, overtime, income tax and loan deduction. The system will automatically
calculate the total income, total deduction and net salary for the employee.
37
ACTIVITY 3B: Fundamentals of Programming Language
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 3B.1, 3B.2, 3B.3, 3B.4 and 3B.5
CASE STUDY
Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of
managing Human Resources (HR) data. Cik Suria was selected to be an IT programmer for
Infinity Design Solution. En. Mohamed insist to develop a system to manage staff payroll. Cik
Suria has to prepare a proposal for payroll system.
INSTRUCTION:
Activity 3B.1
Activity Outcome: Solve problem using Assignment and Arithmetic operators.
Duration : 30 minutes
1. Find the value for the following expression. Show your steps of solution.
a. ( 1 + 2 ) + 6 * 4 / 2 – 1 b. ( 6 + 4 ) / 2 – 4
c. 6 * 3 / 6 + 9 d. 5 + 5 * ( 6 – 2)
38
2. Given integer variables x = 10, y = 7 and z = 2. Determine the value of each of the
arithmetic expression.
a. x + 2y – z b. x / z – (x * x + y)
c. (x * y) % z d. 5 (x + y + z) – x / z
e. xy – xz f. y (x + z) (x – y)
a. p + 3q - r b. p / r + ( p * p + r)
c. r ( p +q ) (p –q) d. 12/ p + ( p + q – r) – 6 / r
39
Activity 3B.2
Activity Outcome: Solve problem using Relational and Logical operators.
Duration : 30 minutes
v. ! Fish || ! (! Fish)
40
2. Given the value a = 0, b = 6 and c = 3. Write TRUE for the true expression and FALSE for
the false expression. Show all the steps clearly.
i. ! ( a == 0) && (b != 2)
41
Activity 3B.3
Activity Outcome: Write expression to solve problem by using appropriate operators.
Duration : 30 minutes
1. Given the value a = 4, b = 8. Find the answer by showing all the steps clearly.
42
2. Given the following scenario. Identify the formula needed that combine operators to
solve the problems.
a. You want to buy 2 different types of magazines. Given the price of the
magazine and the number of magazines purchased, determine and print
the total price to be paid.
b. I-City supermarket provides 15% discount from actual price. Find a solution to
calculate the new price after discount given.
c. You are required to calculate total investment with dividends. Assume that
the profit rate is 7.85% and the amount of your investment is RM15 000.
43
Activity 3B.4
Activity Outcome: Write answer for increments and decrements operators.
Duration : 10 minutes
Determine whether the expression below is TRUE or FALSE and explain why you choose the
answer.
is the same as
x++;
ii. x = x-1;
is the same as
x--;
iii. int a = 5
a++
answer = a is now 6
iv. int a = 5
int c
c = a++
answer = c is now 6
v. int b = 7
++a
answer = a is now 7
iv. int a = 10
a--
answer = a is now 10
iiv. int a = 5
--a
answer = a is now 4
44
• Write the correct expression in a program
Case Scenario by using appropriate operators.
Activity 3B.5
Activity Outcome: System design (process expression/formula )
Duration : 20 minutes
PROBLEM
Case Senario:
The system will automate the process of calculate payroll for employees worked at Infinity Design
Solution Sdn. Bhd. Each employee will be recognized by employee ID. The system will receive gross
income, allowance, overtime, income tax and loan deduction. The system will automatically
calculate the total income, total deduction and net salary for the employee.
45
ACTIVITY 3C: Fundamentals of Programming Language
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 3C.1, 3C.2, 3C.3 and 3C.4
CASE STUDY
Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of
managing Human Resources (HR) data. Cik Suria was selected to be an IT programmer for
Infinity Design Solution. En. Mohamed insist to develop a system to manage staff payroll. Cik
Suria has to prepare a proposal for payroll system.
INSTRUCTION:
3. Illustrate the flow of control structure using pseudocode and flow chart in design
system.
Activity 3C.1
Activity Outcome: Write pseudo code and flowchart for selection control structure in solving
given problems.
Duration : 30 minutes
Based on the problems given, write the pseudo code and flowchart for selection control
structure.
1. Program that receives the current temperature as input. If the temperature is 80 degrees
or more, output a message telling the user to go swimming, otherwise, if the temperature
is 50 degrees or more, output a message to go running, otherwise stay inside.
a. Pseudo Code
46
b. Flowchart
47
2. Jusco Supermarket is now offering some discount on selected items for Carnival Mega
sale. Help the supermarket cashiers to calculate the net price of the selected product’s
below.
Position Discount
1. Food Item 5%
2. Health Item 6%
3. Electric Item 9%
4. Cloth Item 4%
a. Pseudo code
48
b. Write a Flowchart
49
Activity 3C.2
Activity Outcome: Write pseudo code and flowchart using repetition control structures in solving
given problems.
Duration : 30 minutes
1. Based on the algorithm below, prepare a pseudo code and flowchart for each type of
repetition control structures.
a. Pseudo code:
For Loop
50
While Loop
Do..While Loop
51
b. Flowchart:
52
2. A class of ten students took a quiz. The mark is between the ranges 0 - 25 for this quiz is
available to you. Determine the average mark for this quiz. Based on this problem, you
are required to:
Input
Process
Output
Pseudo code:
53
Flowchart:
54
Activity 3C.3
Activity Outcome: Design the pseudocode and flowchart for a given case study using problem
solving tools.
Duration : 30 minutes
1. A car park has the following charges. The 1st hours cost RM2.00. The sub sequent hours
cost RM1.00 per hour. Design the algorithm for this problem and draw flowchart using
problem solving tools.
55
2. Calculate the salary that employee get based on number of working. Rate of the
payment is RM8.00 per hour but the salary will be deducted with 10% KWSP. By using a
repetition control structure, write pseudo code and design a flowchart using problem
solving tools to calculate the total salary of 5 employees and the average salary of the
employee.
56
• illustrate flow of control structure in a
Case Scenario program.
Activity 3C.4
Activity Outcome: System design (write pseudocode and darw flowchart)
Duration : 30 minutes
PROBLEM
Case Senario:
The system will automate the process of calculate payroll for employees worked at Infinity Design
Solution Sdn. Bhd. Each employee will be recognized by employee ID. The system will receive gross
income, allowance, overtime, income tax and loan deduction. The system will automatically
calculate the total income, total deduction and net salary for the employee.
Pseudocode Flowchart
57
ACTIVITY 4A: Basic Programming Codes
Duration: 2 Hours
Learning Outcomes
This lab activity encompasses activities 4A.1, 4A.2 and 4A.3
CASE STUDY
Infinity Design Solution Sdn. Bhd, has received your application as an industrial student to run
your practical in this company for three months. Miss Suria whom is the IT programmer for
Infinity Design Solution is pointed to be your supervisor. As you are new in working environment;
Miss Suria plan to brief you on the programming language elements before major tasks are
appointed to you.
INSTRUCTION:
Your task is to convince Miss Suria that you are familiar with the programming language
elements by filling up all the boxes:
Diagram 1
58
• Identify basic elements of programming
Case Scenario language
Activity 4A.1
Activity Outcome: Programming Language Elements
Duration : 1 hour
Your task is to convince Miss Suria that you are familiar with the programming language
elements by filling up all the boxes:
PROBLEM SOLUTION
Problem 1:
A
Based on the case study programming
B
language, identify the elements noted in A-G
C
D
E
F
G
Problem 2:
You are required to identify the basic
elements of the programming code below: a. Comment :
int main()
d. Reserved word :
{
cout << " Welcome to C++
Programming Language! "; e. Special symbol :
return 0;
} f. Punctuation :
g. Statements :
59
Problem 3:
Program Input:
You need to identify and write out the
program input, process and output. Please
refer to Diagram 1 to answer this question. Process:
Program Output:
60
• Define program code
Case Scenario • Construct flowchart
Activity 4A.2
Activity Outcome: Constructing Flowchart
Duration : 30 minutes
Miss Suria has provided you with extra tasks to perform a flowchart based on the codes given :
// AddTwoNumbers
#include <iostream>
int main()
int a, b, total ;
total = a + b ;
<< endl;
return 0;
61
}
Activity 4A.3
Activity Outcome: Constructing Pseudocode
Duration : 30 minutes
Miss Suria has added you with another tasks to perform pseudocode based on the codes given :
// AddTwoNumbers
#include <iostream>
int main()
int a, b, total ;
total = a + b ;
62
cout << "The sum is " << total
<< endl;
return 0;
Learning Outcomes
This lab activity encompasses activities 4B.1, 4B.2, 4B.3 and 4B.4
CASE STUDY
Congratulations to you!!
You have impressed Miss Suria on your capability to solve the task handed to you in 4A.
Therefore, Infinity Design Solution Sdn. Bhd, with the supervision of Miss Suria has given you the
task to help Finance Unit in completing payroll system. The scenario is that; Infinity Design
Solution announces that it wants to increase employees salary by 13% from gross pay and 5 %
from allowance received.
63
Case Scenario • Identify input, process, output
Activity 4B.1
Activity Outcome: Identify input, process and output
Duration : 30 minutes
Task 1: You must identify the input, process and output from the given task
64
Case Scenario • Construct Flowchart
Activity 4B.2
Activity Outcome: Constructing Flowchart
Duration : 30 minutes
Flowchart
65
Case Scenario • Construct Pseudocode
Activity 4B.3
Activity Outcome: Constructing Pseudocode
Duration : 30 minutes
Pseudocode
66
Case Scenario • Write Program Code
Activity 4B.4
Activity Outcome: Write program code
Duration : 30 minutes
Program Code
67
68