The code above counts up numbers and for every multiple of 3 it shows the word Fizz, for every multiple of 5 it shows buzz, however if it is a multiple of both, it says fizz buzz. I added onto it so every multiple of 7 it says BuzzFizz and multiple of 11 Ziz. The code about works by counting up numbers, every time it does it checks if that number is divisible by 3 or 5 and if it is then it says Fizz or Buzz. If ever the number is divisible by both then it says FizzBuzz. Every time it does this it notify's the label and changes the number. This is the same for 7 and 11 and will change it to BuzzFizz or Ziz. When the device is shook, the counter resets.
Coding Drills- If/Else
Exercise 1: This code above says that when ButtonTestit is clicked, it will change the global number to the text wich is blank. Then the if else block will check if the the text is greater than 100. After it will set the labelouput to join the first output with a line break and the input >100.
Exercise 2: In the blocks above, it check's of the number if it is odd or even using the modulo of the number inputted by user divided by 2. If the number is not equal to 1 it will be even, and if the number is equal to 1, it's odd.
Exercise 3: This blocks of code above shows that it will get a number that is divisible by 2, 3, 5 when a user enters a number and clicks the buttontestit then divided by 2 or 3 or 5 and = 0.
Exercise 4: This blocks of code above check's if the age will be an adult, senior or youth. It checks if the age is less than, equal to, or greater than a range of numbers, then it will determine what group it will be in.
Coding Drills- Refactoring Code
Exercise 1: The code before this one showed had multiple actions to take before getting a answer. This code is simpler, because it goes to the procedure which has the code and states the long part twice.
Number 2: This procedure will be used every time the procedure statement is used, because of the call block. This helps refactor the code because it makes it shorter and so more organized.
Number 3: The blocks above uses a function to get a result. This can be added to the statement because it does the math and gets the results of the function.