APCS-P ModuleSixLessonTwoActivityGuide

docx

School

Trident Technical College *

*We aren’t endorsed by this school

Course

12

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by EarlIce11831

Report
Google Doc Access Directions: Please click on File in the upper left corner. If you are working on a Chromebook or Google Docs, choose the Make a copy option and save a copy of the document to your Google Drive. If not, choose the Download as option and then the Microsoft Word (.docx) option to download an editable copy of the document to your computer. Module Six Lesson Two Activity Guide Navigate to the Ticket Generator App in code.org You can use the indicated supplies(sticky notes) or these digital manipulatives to work your way through the activity. DIRECTIONS : In this activity, you will develop two (or more) algorithms to find the winning ticket among a group of tickets. The winning ticket will be revealed and you must describe how you will search the tickets that were sold to find the winner. Activity 1 (20 points total) In the space below, describe the algorithm you would use to find a winning number in a list of tickets (5 points) : Use the app generate 3 tickets values to test your algorithm for 3 tickets . (15 points) Select 3 tickets from the dropdown. Click Pick Winner Following your algorithm, click on each ticket image. Record how many clicks it took to find the winning number. Repeat 3 times (click new numbers), and record the number of clicks. Record the number of clicks needed to find the winning number: Test 1: Test 2: Test 3: Activity 2 (15 points) Use the app to test your algorithm with 6 tickets . Select 6 tickets from the dropdown.
Click Pick Winner Following your algorithm, click on each ticket image. Record how many clicks it took to find the winning number. Repeat 3 times (click new numbers), and record the number of clicks. Record the number of clicks needed to find the winning number: Test 1: Test 2: Test 3: Predict: (15 points) Think about what would happen if we had ten tickets, enough tickets for the whole class or the whole school? This is the linear search pattern. What would happen if we had 1000 tickets? What is the most number of clicks it would take? What is the pattern here? Activity 3: (15 points) Create an algorithm to determine if the winning number is in a list of sorted tickets. (the top ticket has the lowest value and the bottom ticket has the highest). Click on this Sorted Ticket App. The search can start at any of the tickets. You can "jump" over tickets. In other words, you don't need to search the tickets in order. You can determine which ticket to click next based on the current ticket you are checking. The goal is to make the determination in the least steps possible, but don't forget your number could be anywhere in the list - what is the worst possible case? What is the greatest number of comparison steps it would take to find any number in your list using your current algorithm? Challenge algorithm: 2
Record the number of clicks needed to find the winning number when testing your sorted ticket algorithm for 6 sorted tickets (15 points) : Test 1: Test 2: Test 3: Watch this short video of how a Binary Search might work and answer the following questions. (20 points) How does your sorted ticket algorithm compare to the binary search algorithm? If you had two tickets, which algorithm would you use to get a match with the fewest amount of steps? What if you had five? What about one hundred? Check out this Binary Search Pattern . 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help