Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please see screenshot attached. The value of comparison count is not 4 5 I dont know where is mistake. Please I am expecting to write

Please see screenshot attached. The value of comparison count is not 45 I dont know where is mistake. Please I am expecting to write the whole script so that when_green_flag_clicked is run, the value of comparison_count is 45. This is OU BUILD. OUBuild
File 7
Edit >
TM111_02_Q4
computerclub?1Diya2Aiden3Quinlan4Fatima5Mei6Soledad7Zoltan8Oksana9Isla10Ulrike?length:10
comparison_count
0
position
1
other_position
2
show list computer_club .
Task: In this part you will investigate how many comparisons between list items exchange sort requires to sort some lists of different lengths.
i.To count the comparisons, we have provided a variable comparison_count.
The only place where list items are compared is in the when_green_flag_clicked script. Add a block to this script at an appropriate point to increment comparison_count each time two list items are compared.
We are not quite done, because comparison_count needs to be initialised to 0 at the start of the when_green_flag_clicked script, before we start the sort. Add a block to initialise comparison_count at an appropriate point in the script.
Then make sure the watcher for comparison_count is visible on the stage, and run the when_green_flag_clicked script.
You should find that once the script has run the value of comparison_count is 45.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

How can we confi rm both ourselves and others?

Answered: 1 week ago