Taylor is writing an algorithm to record the results of an experiment - OCR - GCSE Computer Science - Question 3 - 2021 - Paper 1
Question 3
Taylor is writing an algorithm to record the results of an experiment.
Taylor needs to be able to enter a numeric value which is added to a total which initially st... show full transcript
Worked Solution & Example Answer:Taylor is writing an algorithm to record the results of an experiment - OCR - GCSE Computer Science - Question 3 - 2021 - Paper 1
Step 1
Write an algorithm to implement Taylor's requirements.
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Initialize total to 0.
While total is less than or equal to 100:
Prompt user to 'Enter a number':
Read input value
Add value to total
Display total
End.
Step 2
State what is meant by a real data type and give an example of this data type.
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
A real data type refers to numbers that can contain decimal points, representing continuous values. An example of a real data type is 23.75.
Step 3
State what is meant by an integer data type and give an example of this data type.
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
An integer data type refers to whole numbers without any decimal points. An example of an integer data type is 42.
Step 4
Write a pseudocode algorithm that uses iteration to allow Taylor to:
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!