Question: This project is intended to implement a program to help the teacher record how many paintings pupils have completed during the school term, up to
This project is intended to implement a program to help the teacher record how many paintings pupils have completed during the school term, up to a maximum of paintings.
Before recording the number of paintings completed by each pupil, the teacher will start the program using the green flag. She will then press her space key whenever she wants to record a pupils number of paintings, which she will enter out of a maximum of If the number, as a percentage of the maximum of is more than then the pupil will be awarded a Renoir sticker.
In this project, we have provided a whengreenflagclicked script and a whenspacekeypressed script. Consider these scripts carefully and then answer the questions below.
aComplete the stepbystep description below of what the whenspacekeypressed script does when the user starts the program using the green flag, then presses the space key, and enters Rowan and then
The user is asked to enter a pupils name. Their input, Rowan is stored in the variable name.
The user is asked to enter the number of paintings completed by the pupil out of a maximum of
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 here, with the inputs Rowan and not what the script does in general or what might have happened with different inputs.
marks
b
iIdentify 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.
mark
iiWhat might be an appropriate name for the constant you have chosen?
mark
cAmend the whengreenflagclicked and whenspacekeypressed scripts so that:
If a pupil completes more paintings than of the maximum, their name is added to the list Renoirlist.
Otherwise, their name is added to a list Kahlolist which you should create and initialise appropriately
Take a screenshot of your resulting scripts and paste it into your TMA document.
marks
d
iFurther amend the whengreenflagclicked and whenspacekeypressed scripts so that:
If a pupil completes more paintings than of the maximum, their name is added to the list Renoirlist.
If a pupil completes fewer paintings than of the maximum, their name is added to a list Picassolist which you should create and initialise appropriately
Otherwise, their name is added to the list Kahlolist.
Check that your program passes the following tests. You arent expected to give any details of your testing; this is just to help you check your program.
Test number Test purpose Test inputs Expected results
Paintings completed, out of a maximum number of Name Name added to list
Just below lower boundary value p Picassolist
Lower boundary value
equivalent to
p Kahlolist
Just above lower boundary value p Kahlolist
Just below upper boundary value p Kahlolist
Upper boundary value
equivalent to p Kahlolist
Just above upper boundary value
p Renoirlist
Take a screenshot of your resulting scripts and paste it into your TMA document.
marks
iiDifferent forms of selection structure could be used to meet the specification in Qdi Briefly describe an alternative form of selection structure to the one you chose.
marks
Save your final version of the OUBuild project for Question and submit it as TMQPIsbwhere PI is your OU personal identifier, eg A in your TMA zip file. Alternatively, you may use your OUCU instead of your PI
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
