Computer Science > EXAM > TM111TMA02.docx (All)
Question 1. a, When the green flag is pressed any data stored is deleted. When the space key is pressed the user is asked to enter the pupils name into the first variable, followed by entering the p... upils attendance, out of 50 days into the second variable, the user is then presented with the third variable, a percentage of the pupils attendance before the pupil is added to the appropriate list. b, A constant is a variable that does not change during the programme. An example used in this programme would be the variable ‘name’ which could be changed to PUPIL. c, d,1 d,2 An alternative form of selection structure to the attendance programme could be to change the percentage used for satisfactory attendance to 89% which will send 45 days attendance, equivalent to 90% to the satisfactory list and 44 days attendance, equivalent to 88% to the low attendance list. 1 This study source was downloaded by 100000841689952 from CourseHero.com on 07-24-2022 02:32:18 GMT -05:00 https://www.coursehero.com/file/54291092/TM111TMA02docx/ . Question 2. Question 3. a, input a word, working through the letters in the original word from first to last identify the vowels and duplicate, output the word. b, 2 This study source was downloaded by 100000841689952 from CourseHero.com on 07-24-2022 02:32:18 GMT -05:00 https://www.coursehero.com/file/54291092/TM111TMA02docx/ c, Test Number Test purpose Inputs Word Expected Results New word displayed 1. test last letter a vowel hippo hiippoo 2. test vowels u, e, a umbrella uumbreellaa 3. test vowels o, i spoil spooiil Question 4. a, Test Number Test purpose Existing data flowerpots Test inputs position Expected Results flowerpots 1. Swap last two items 5, 1, 2, 4, 6, 0, 7, 3 8 5, 1, 2, 4, 6, 0, 3, 7 2. Swap first two items 5, 1, 2, 4, 6, 0, 7, 3 2 1, 5, 2, 4, 6, 0, 7, 3 3. Swap items 5 and 6 5, 1, 2, 4, 6, 0, 7, 3 6 5, 1, 2, 4, 0, 6, 7, 3 b, 3 This study source was downloaded by 100000841689952 from CourseHero.com on 07-24-2022 02:32:18 GMT -05:00 https://www.coursehero.com/file/54291092/TM111TMA02docx/ c, d, There are 7 comparisons. There are 8 comparisons. If 1000 items already in ascending order were added, the comparisons would be 999 because the list is already sorted. There are 56 comparisons for flowerpot 2. My results for flowerpot 2 agree with the teacher's formula. n x (n-1) = 8 x 7 = 56. There are 240 comparisons for flowerpot 3. My results for flowerpot 3 agree with the teacher's formula. n x (n-1) = 16 x 15 = 240 [Show More]
Last updated: 2 years ago
Preview 1 out of 4 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Jul 24, 2022
Number of pages
4
Written in
This document has been written for:
Uploaded
Jul 24, 2022
Downloads
0
Views
80
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·