TCP Lab 01
TCP Lab 01
Objectives
To differentiate between algorithm, pseudocode and flowchart
To learn usage of algorithm, pseudocode and flowchart
Algorithm
It is a step by step instruction on how to solve a problem. E.g. “how to” guides on fixing your bicycle.
Pseudocode
It is a natural language like statements that focus on the logic of a problem. Pseudocode is a problem
solving design that guides you in programming. Each statement of the pseudocode should guide the
reader and the reader should be able to translate it to a specific programming language statement. E.g.
READ the height of the user.
Flowchart
A diagram that helps describe the steps of the pseudocode/algorithm using symbols and directional
arrows.
Question 1
Your program should accept 2 numbers from user then display the sum of those numbers.
Write the pseudocode and draw the flowchart.
Question 2
You are required to calculate the payment of a worker from the input Hours and Rate. The formula
for the payment is: Pay = Hours*Rate. Display the payment after the calculation.
Write the pseudocode and draw the flowchart.
Question 3
You are required to calculate the standard (you may use the answer from Question 2) and overtime
payment. The formula for the payment is given:
Standard (Less than or equal to 40 hours): Pay = Hours*Rate;
Overtime (More than 40 hours): Pay = 40*Rate + (Hours – 40)*1.5*Rate.
Write the pseudocode and draw the flowchart.
Question 4
Your program should accept 10 numbers from the user then display the average of those numbers.
Write the pseudocode and draw the flowchart.