You are on page 1of 4

1|Page

ITPPA Assignment
Table of Contents
Section A ......................................................................................................................... 3
Question 1.................................................................................................................... 3
Question 2.................................................................................................................... 4
Bibliography .................................................................................................................... 4

2|Page
Section A
Question 1
1.1)1. 1. basic_salary: real
2. km._travelled:real
3. overtime_hours: real
4. sundry_contributions: real
5. travel_allowance_rate: real
1.2) overtime_pay = overtime_hours * (basic_salary / (20*7)) * 1.5. (Birt)
1.3) An algorithm is a set of rules to be followed during calculations or other
troubleshooting procedures. It is a well-defined sequence of instructions that can be
followed to achieve the desired result. An array is a collection of elements of the
same variable type stored in contiguous memory locations. It is one of the most
popular and simplest data structures, often used to implement other data structures.
Each element of the array is indexed starting at 0. (GeeksforGeeks)
1.4) Variables
Declare: no_employees, overtime_hours, total_overtime as float
Input:
employees = [
display: “Enter name:”, “Enter overtime hours worked:”
enter name and overtime_hours
display: “Enter name:”, “Enter overtime hours worked:”
enter name and overtime_hours
display: “Enter name:”, “Enter overtime hours worked:”
enter name and overtime_hours
display: “Enter name:”, “Enter overtime hours worked:”
enter name and overtime_hours
display: “Enter name:”, “Enter overtime hours worked:”
enter name and overtime_hours
display: “Enter name:”, “Enter overtime hours worked:”
enter name and overtime_hours
display: “Enter name:”, “Enter overtime hours worked:”
enter name and overtime_hours
]
Process:
total_overtime = 0
total_overtime = employee * [“overtime_hours”]
Output:
display: “Total overtime hours: {total_overtime} (Symonds)
1.5) The basic structure of the two loops is similar. The main difference is the
condition that controls the execution of the loop. With the Do While loop if the
conditional expression is true, the statements are executed, and the program goes
back to test the condition expression. The program loops until the conditional
expression is true. With the Do Until loop if the conditional expression is true, the
program goes to the statement after End Do. If the conditional expression is false,
the program begins executing the statement again. (Easytrieve)

3|Page
Question 2
2.1) Variables:
Declare: salary as float, name, surname as string
Input:
employees = [
display: “Enter name:”, “Enter surname:”, “Enter salary:”
enter name, surname, salary
display: “Enter name:”, “Enter surname:”, “Enter salary:”
enter name, surname, salary
display: “Enter name:”, “Enter surname:”, “Enter salary:”
enter name, surname, salary
display: “Enter name:”, “Enter surname:”, “Enter salary:”
enter name, surname, salary
display: “Enter name:”, “Enter surname:”, “Enter salary:”
enter name, surname, salary
display: “Enter name:”, “Enter surname:”, “Enter salary:”
enter name, surname, salary
display: “Enter name:”, “Enter surname:”, “Enter salary:”
enter name, surname, salary
]
Output:
display: employee[‘name’] employee [‘surname']: employee [‘salary’]
2.2) A trace table is a technique used to test an algorithm and predict step by how the
computer will execute the algorithm. It can be used to understand or predict the
behavior of an algorithm and to identify possible logic errors. (101Computing.net)
i myArr[i] Low High
0 3 3 3
1 7 3 7
2 1 1 7
3 4 1 7

Bibliography
101Computing.net. 101Computing.net. 5 October 2019. 22 June 2023.
Birt, Jamie. indeed. 27 February 2023. 14 June 2023.
Easytrieve. Broadcom. 24 May 2023. 20 June 2023.
GeeksforGeeks. 8 May 2023. 19 June 2023.
Symonds, Cat. Factorial. 1 June 2023. 22 June 2023.

4|Page

You might also like