A+ Computer Science
LIST COUNTING
Lab Goal: This lab was designed to teach you how to use lists in Scratch.
Lab Description: Write a program in Scratch that will use a list. The list will store a group of random
numbers in a list and then count how many times a certain number exists in the list.
Step One :: Go to the variables / data section and make a list named numbers. Go to the variables/data
section and make variables named count, numNumbers, spot, and toCount. Numbers is a list that will store
the random numbers from 1 to 10, numNumbers will store the number of numbers in the list, spot will be used
to access each number in the list, toCount is the number provided by the user that will be used to search the
list, and count will be the number of times the number occurs in the list.
Step Two :: Add in code so that when the green flag is clicked an input box appears asking for the number of
numbers to be stored. Next, a loop should run and load numNumbers random numbers into the list. The
program should count up how many times the user supplied number appears in the numbers list.
Step Three: Create another section of code that when the space bar is pressed the sprite will say the total
number of numbers and your program will remove each number from the list one by one every one second
starting from the last number using spot variable
Note: You don't need the variable randNum showing on the pictures.
Output:



Answer :

Other Questions