• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

TM111 TMA02. EXAM-with 100% verified solutions-2023update

Document preview thumbnail
Preview 2 out of 8 pages

TM111 TMA02. EXAM-with 100% verified solutions-2023update TM111 TMA02. EXAM-with 100% verified solutions-2023update TM111   TMA02 * Question 1 What the script will do when the spacebar is pressed it record the name of the pupil and how many books they have read, then work out their reading percentage. we were hoping for something like: … Their input, 12, is stored in the variable books_read. The variable percentage_read is set to the value of books_read multiplied by 5 (or to the percentage equivalent of books_read) which in this case is 60. The user is told the percentage of books read (60%). The script then checks whether 60 is less than 70 and finds it is so the pupil's name, 'Frank', is added to low_reading_list. 0/4 Since the value 12 was given you can use exact values, percentages etc. for a clear example. *1b Value of the constant is BOOKS, as we know there are 20 and this doesn’t change. *1c BOOKS would be an appropriate name for the constant. I will accept this answer. 2/2 chosen constant and you adhered to formatting conventions. Screen shot of low & satisfactory below This study source was downloaded by from CourseH on :39:25 GMT -05:00 Crop screencopies to what we neeed. 4/5 Well done, you even initialized the second list. I deduct 1 mark for leaving too many test- variables hanging around. *d Below all 3 high, satisfactory and low reading 6/7 You even initialized the third list. Good logic from initialization, selection to output. But too may variables around that are not used. . *d (ii) Input the information without the use of percentages and used lesser than and greater than symbols to get the same result or use 3 “ifs” instead on “if” and “else” brackets/ 2/2 nice alternative and explanation. * Question 2 This study source was downloaded by from CourseH on :39:25 GMT -05:00 Clearly unfinished code and inexplicable attempts to merge the flutter and sink blocks back into the main code-block? The code does not work correctly because of the rounding not resulting in exact matches the result is always “sink”. 1/8 I was disappointed how you formed and displayed the incorrect answer using flawed techniques. You did show you understand loops, but you raised concerns by merging defined blocks back into the codebase. 1/12 I was disappointed how you arrived at the wrong actions. You kept flutter in tact, but partially re-merged it and created sink_down using parts of the define in the main block using music, but without using costumes, backdrops etc.. *Question 3 Algorithm – Input word, replace vowels from word with dollar sign and output word. Make new word with vowels replaced by dollar sign Output new word. *b This study source was downloaded by from CourseH on :39:25 GMT -05:00 Unfinished code. Does not meet the requirements. Does show initial inkling of understanding of coding. Should look something like: 02/11 program including, input, but most of the logic not close to meeting requirements. *Question 4 *a Test number Test purpose Existing data Expected result This study source was downloaded by from CourseH on :39:25 GMT -05:00 Unsorted list Pigeonholes 1 Length of unsorted list in less than number in unsorted list List contents 4 2 8 1 3 7 List contents 8 Empty items 2 Sorted numbers in unsorted list into their counterparts in pigeonhole list 4 2 8 1 3 7 1 2 3 4 7 8 3 To see the number of comparisons between list items needed to find largest number in unsorted list 1 2 3 4 7 8 1 2 3 4 5 6 2/2 two realistic tests. *b This study source was downloaded by from CourseH on :39:25 GMT -05:00 First list sorted from the unsorted list to pigeonhole list. *b ii Next list moved to the sorted list. 7/7 for c_pressed. That block just works and works correctly. Congrats. *c This study source was downloaded by from CourseH on :39:25 GMT -05:00 Length of unsorted list 6 should start with 10 20 30 40 Number of comparisons between list items needed to find largest number in unsorted list 5 9 19 29 39 The list appears to be linear as it grows at a steady pace yes. ii Largest number in unsorted list 8 10 20 30 40 Number of comparisons between items in 7 19 29 39 pigeonhole and empty string should be: 10 20 30 40 This table also appears to be linear yes 2/4 for partially correct tables and answers. *d The amount of comparisons to find the largest number (100) of a set of 50 numbers would be (n=50) x (n=50)/2 = 1250 comparisons. 0 for Pigeonsort as it doesn’t do comparisons as a sorting algorithm. selection sort of 50 items would need 50 x (50 -1)/2 = 1225 comparisons. ii Yes this is true as pigeonsort doesn’t take the time to compare numbers with numbers in a list in order to find the answer of which is the largest. no it is only sometimes true. Not for very large numbers. iii 1 possible disadvantage of piegeonhole sort is that it doesn’t work with decimal numbers only whole positive, negative and zero numbers. yes 2/6 for 2 correct answers. This study source was downloaded by from CourseH on :39:25 GMT -05:00

Content preview

TM111 TMA02. EXAM-with
100% verified solutions-
2023update
TM111 https://www.coursehero.com/file/146403292/TM111-TMA02docx/TMA02
* Question 1
What the script will do when the spacebar is pressed it record the name of the pupil and how many
books they have read, then work out their reading percentage.
we were hoping for something like:
… Their input, 12, is stored in the variable books_read. The variable percentage_read is set to the value of books_read multiplied by 5 (or to the percentage equivalent of books_read) which in this case is 60.
The user is told the percentage of books read (60%).
The script then checks whether 60 is less than 70 and finds it is
so the pupil's name, 'Frank', is added to low_reading_list.
0/4 Since the value 12 was given you can use exact values, percentages etc. for a clear example. *1b
Value of the constant is BOOKS, as we know there are 20 and this doesn’t change.
*1c
BOOKS would be an appropriate name for the constant.
I will accept this answer. 2/2 chosen constant and you adhered to formatting conventions. Screen shot of low & satisfactory below
This study source was downloaded by 100000831777157 from CourseHero.com on 07-12-2022 04:39:25 GMT -05:00

Document information

Uploaded on
January 18, 2023
Number of pages
8
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers
$15.99
Purchased by 9 students

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
abram23
4.0
(142)
Sold
676
Followers
546
Items
3336
Last sold
4 months ago

Reviews from verified buyers




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions