Unit 4 - Pseudocode Assignment
Unit 4 - Pseudocode Assignment
2) A company has 600 employees whose names are currently stored using a array called
NAMES.
The names are stored as surname, first name. For example: Smith, Jane, Uysal,
Rafael, Ahmed, Ishmael, Jonsonn, Sara, …
2.a) Construct a pseudocode algorithm that will store the surnames in one array and first
names in another. [4]
2.b) Construct a pseudocode algorithm that will sort the surnames into alphabetical order
using the bubble sort method. The order of the first names must also be changed so that they
keep the same index as their corresponding surname. [5]
The grade boundaries for the individual grades are shown below:
4.a) Construct an algorithm using pseudocode to take the marks that have been stored
in MARK[], convert them into the appropriate grade and store the calculated grades in
GRADE[]. [5]
4.b) Construct an algorithm using pseudocode to output the names and grades of all students
who achieve a grade of Merit or Distinction. [3]
5) The following method, calcBMI()accepts person’s height (H) in metres (m) and weight
(W) in kilograms (kg) and returns their Body Mass Index (BMI).
calcBMI(H, W)
X=H*H
B=W/X
return B
endcalcBMI
Boris weighs 104 kg and is 2.00 m tall. His BMI can be calculated by calling method calcBMI()
as follows
The data about a group of adults and their height measurement (in metres) and weight
Where
For example,
NAME[0]is Annie.
2. Use pseudocode to construct an algorithm which accepts a person’s BMI and outputs the
4. Construct an algorithm which will output the names of all the people whose BMI is greater