Four pseudocode descriptions and five pseudocode statements are shown.
Some pseudocode statements will not be used.
Did this page help you?
Four pseudocode descriptions and five pseudocode statements are shown.
Did this page help you?
Tick (✓) one box to show the named section of a program that performs a specific task.
A | file | |
B | function | |
C | parameter | |
D | process |
[1]
Did this page help you?
A function is declared using pseudocode.
FUNCTION ConvertToCm(Inches: REAL) RETURNS REAL
RETURN Inches * 2.4
ENDFUNCTION
Tick (✓) one box which accurately describes the use of the variable Inches
A | answer | |
B | call | |
C | parameter | |
D | response |
[1]
Did this page help you?
The variables X, Y and Z are used to store data in a program:
[6]
Did this page help you?
TASK 1 – Set up arrays
Set-up one dimensional arrays to store:
• Student names
• Student marks for Test 1, Test 2 and Test 3
o Test 1 is out of 20 marks
o Test 2 is out of 25 marks
o Test 3 is out of 35 marks
• Total score for each student
Input and store the names for 30 students. You may assume that the students’ names are unique.
Input and store the students’ marks for Test 1, Test 2 and Test 3. All the marks must be validated on entry and any invalid marks rejected.
TASK 2 – Calculate
Calculate the total score for each student and store in the array.
Calculate the average total score for the whole class.
Output each student’s name followed by their total score.
Output the average total score for the class.
TASK 3 – Select
Select the student with the highest total score and output their name and total score.
[5]
[1]
Did this page help you?
inputs three numbers
outputs the largest of the three numbers
[3]
Did this page help you?
Task 1 – Setting up the voting system to allow a tutor group to elect a representative. Write a program to:
When all students have voted, display the name of the tutor group, the votes for each candidate and the name of the candidate who has won the election. If there is a tie for first place, display all candidates with the equal highest number of votes.
Task 2 – Checking that students only vote once.
Each student is given a unique voter number by their teacher.
Extend Task 1 to achieve the following:
[5]
Task 3 – Showing statistics and dealing with a tie. Extend Task 2 to achieve the following:
Did this page help you?
Name and describe the most appropriate programming data type for each of the examples of data given. Each data type must be different.
Data: 37
Data type name ............................................................................
Data type description ..................................................................
Data: Cambridge2021
Data type name .............................................................................
Data type description ...................................................................
Data: 47.86
Data type name .............................................................................
Data type description ...................................................................
[6]
Did this page help you?
The pseudocode algorithm shown has been written by a teacher to enter marks for the students in her class and then to apply some simple processing.
Count ← 0
REPEAT
INPUT Score[Count]
IF Score[Count] >= 70
THEN
Grade[Count] ← "A"
ELSE
IF Score[Count] >= 60
THEN
Grade[Count] ← "B"
ELSE
IF Score[Count] >= 50
THEN
Grade[Count] ← "C"
ELSE
IF Score[Count] >= 40
THEN
Grade[Count] ← "D"
ELSE
IF Score[Count] >= 30
THEN
Grade[Count] ← "E"
ELSE
Grade[Count] ← "F"
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ← Count + 1
UNTIL Count = 30
Describe how you could change the algorithm to allow teachers to use it with any size of class.
[3]
Did this page help you?