Using OUBuild (Scratch) programming. This project is intended to implement a program to…
- User
Using OUBuild (Scratch) programming.
This project is intended to implement a program to help the teacher record the number of birds recently counted by the pupils on a nature walk.
Before recording each pupil’s score, the teacher will start the program using the green flag. She will then press her space key whenever she wants to record a pupil’s bird count, which is a whole number out of a maximum of 80. If the number, as a percentage of the maximum of 80, is more than 85%, then the pupil will be awarded a Wren sticker.
In this project, we have provided a when_green_flag_clicked script and a when[space]key_pressed script. Consider these scripts carefully, and then answer the following questions:
a.Imagine a scenario in which the user starts the program with the green flag, then presses the space key, enters ‘Keon’, and then 70 when prompted.
Copy and complete the following step-by-step description of what happens, starting from the point at which the user is prompted for input.
The user is asked to enter a pupil’s name. Their input, ‘Keon’, is stored in the variable name.
The user is asked to enter the score achieved by the pupil out of a maximum of 80…
Your description should make clear what data is stored in the variables and the list involved, and the result of any comparison that is made.
You should describe what happens in the particular scenario described here, with the inputs ‘Keon’ and 70, not what the script does in general or what might have happened with different inputs.
(4 marks)
- Assistant
Here is a completed step-by-step description based on the given scenario:
The user is asked to enter a pupil’s name. Their input, ‘Keon’, is stored in the variable name.
The user is asked to enter the score achieved by the pupil out of a maximum of 80. Their input, 70, is stored in the variable score.
The name ‘Keon’ is added to the list of pupil names, and the score 70 is added to the corresponding list of scores.
The program calculates the percentage score by dividing 70 by 80, which equals 0.875 or 87.5%. Since 87.5% is greater than 85%, the program awards Keon a Wren sticker (for example, by displaying a message or adding a sticker symbol).
This description clearly specifies the data stored, the update to the list, the calculation, the comparison, and the final result based on the inputs ‘Keon’ and 70.
- User
b.
i.Identify a numerical value used in this program that might appropriately be stored in a constant. (Recall that a constant is a value that plays a significant role in a program and does not change during the time the program is running.) There may be more than one possibility but you are only required to identify one. You are not asked to implement this constant.
(1 mark)
ii.What might be an appropriate name for the constant you have chosen?
- Assistant
b.
i. A numerical value that might appropriately be stored in a constant is 80, the maximum possible score for each pupil.
ii. An appropriate name for this constant could be MAX_SCORE.