B B B B B B B B B B
TMA02
* Question 1
BB BB
What the script willdowhen the spacebar is pressed it recordthe nameofthe pupil and howmany books
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
they have read, then work out their reading percentage.
BB BB BB BB BB BB BB BB BB
wewerehopingforsomething like:B B B B BB
…Their input, 12, isstoredinthe variablebooks_read.
B BB BB BB BB B B BB B B B
The variable percentage_read is set to the value of books_read multiplied by 5 (or to the percentage
BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB
equivalent of books_read) which in this case is 60.
BB BB BB BB BB BB BB BB BB
Theuseristold the percentage ofbooksread(60%).
B BB B BB BB BB B B B
Thescript thenchecks whether 60 is less than 70and findsit is
BB BB B BB BB B B BB BB BB BB BB B BB
sothepupil'sname, 'Frank', isadded tolow_reading_list.
B B BB BB BB B BB B
0/4 Sincethevalue12 wasgivenyoucanuseexactvalues, percentagesetc.for a clear example.
B B B B B BB B BB B BB B B BB BB BB BB BB BB
*1b
Valueoftheconstant isBOOKS,asweknow thereare20 andthisdoesn’tchange.
B B B BB BB B BB B BB B B BB BB BB B
*1c
BOOKSwouldbeanappropriatenamefortheconstant. B B B B B B BB B
Iwillacceptthisanswer.2/2 chosenconstantandyouadheredtoformatting conventions. Screen
B B B B B B B B B B B B B BB BB
shot of low & satisfactory below
BB BB BB BB BB BB
https://www.coursehero.com/file/146403292/TM111-TMA02docx/
, This study source was downloaded by 100000840820515 from CourseHero.com on 01-20-2023 05:01:33 GMT -06:00
BB BB BB BB BB BB BB BB BB BB BB BB BB
https://www.coursehero.com/file/146403292/TM111-TMA02docx/