Unit 5 Lesson 8 Name(s)________Deven Bali____________________ Period __5___ Dat

Unit 5 Lesson 8 Name(s)________Deven Bali____________________ Period __5___ Date ____11/10/2021________ Activity Guide - Loops Make Step 1 - Try the app Try using the different combinations of inputs. ● What does each button change and what does it not change? Discuss with a Partner ● Where (if at all) do you think this app is using a list? ● Where (if at all) do you think this app is using a loop? Step 2 - Plan Fill in the information in the table below for each event handler you'll need to create Element ID Description of What the Event Handler will Do shapesButton Makes a random shape appear on screen colorsButton Changes the screen to a random color locationButton Moves said shape to a random location on screen Fill in the table below for each variable you'll need to create. Variable Name What the Variable Stores shape Stores all the possible shapes to be displayed in the program color Stores all the various colors for the program Computer Science Principles 1 Twenty images with IDs "icon0", "icon1" … "icon19" "colors Button" "locatio nsButto n" "shapes Button" "homeS creen" Unit 5 Lesson 8 Step 3 - Write Your Code ● Write the code for the app, using your plan above and the comments provided in Code Studio to help ● Steps You Can Follow ○ Create all the variables from your table above. ○ Give your variables a starting value using the assignment operator (=). ○ Create blank event handlers (onEvent) for each screen element in your table above. ○ Write the code to make each of the three buttons work. ○ Hint: in order to create random colors use the rgba() block with randomNumber(). Read the documentation for those blocks if you need more help. ○ Use your debugging skills to identify unexpected behavior and fix your program. ○ Comment your code as you go, explaining what each event handler does. ● Extension Ideas ○ Create a way to hide the three buttons when you have a lock screen that you like ○ Add sounds to each button. ○ Change the code for the "shapes" button to guarantee that you never randomly get the same shape twice in a row. Step 4 - Submit Before you submit, check the rubric below to make sure your program meets the requirements of the task. Category Extensive Evidence Convincing Evidence Limited Evidence No Evidence Input onEvents are created for all the required inputs. onEvents are created for most of the inputs. onEvents are created for some of the inputs. onEvents are not created for any inputs. Variables and Lists Variables and lists are created and appropriately used for all pieces of information used in the app. Variables and lists are created and appropriately used for most pieces of information used in the app. Some information is stored in variables and lists and appropriately updated throughout the app. There are no variables or lists which store the necessary information for the app to work correctly. Loops The program correctly uses loops for all three buttons to generate the expected output. The program correctly uses a loop for two of the buttons to generate the expected output. The program correctly uses lists for one of the buttons to generate the expected output. The program does not include or correctly use any loops. Output All three buttons work as expected to move icons, change their colors, and change their icon to a random new icon. Only two of the buttons work as expected. Only one of the buttons work as expected. None of the buttons work as expected. Code runs without errors. No errors are present in the required code. Some errors are present in the required code. Many errors are present in the required code. The code does not run. Comments Comments are used to correctly explain the purpose and functionality of both the function and event handlers. Comments are used to explain the purpose and functionality of either the function or event handlers. Comments are present, but are not used to explain the purpose or functionality of the function or event handlers. Comments are not present. Computer Science Principles 2 uploads/S4/ twenty-images-with-ids-quot-icon0-quot-quot-icon1-quot-quot-icon19-quot-quot-colors-button-quot-quot-locatio-nsbutto-n-quot-quot-shapes-button-quot-quot-homes-creen-quot.pdf

  • 29
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager
  • Détails
  • Publié le Aoû 05, 2022
  • Catégorie Law / Droit
  • Langue French
  • Taille du fichier 0.1120MB