Tuesday, 8 January 2019

Bonus Computer Program Challenges

Need an extra challenge when programming in class? Try these!

1) Write a program called "LeapYear" in which the user is asked to enter a value - a year to be tested to see if it is a leap year. Have the program say either, yes, the entered year is a leap year, or no it is not.

Hint: How to Calculate a Leap Year
  1. Start off using the year you want to calculate.
  2. See if it is evenly divisible by 4 (a whole number with no remainder). If it is not, like 1997, it is not a leap year. ...
  3. See if the year is divisible by 100. If a year is divisible by 4, but not 100, like 2012, it is a leap year. ...
  4. See if the year is divisible by 400. If a year is divisible by 100, but not 400, like 1900, then it is not a leap year. If a year is divisible by both, then it is a leap year. So 2000 was indeed a leap year. 
Hint 2: Try using the "modulo" or "mod" operator. The modulo operation finds the remainder after division of one number by another. e.g. 10 mod 2 = 0, 10 mod 3 = 1, 5 mod 2 = 1, 1999 mod 4 = 3. 2012 mod 4 = 0.

2) Write a program that asks the user for a number and then outputs all prime numbers less than that number. (Look up "Sieve of Eratosthenes" for help with an algorithm.)

3) Create a program that simulates the rolling of two six-sided dice and calculates the sum of the two face values. Have the user enter how many times the dice will be rolled. Keep track in a List of the total number of times that each possible sum was observed. Specifically, create a List called "Sums" and in position 1, count all the times there is a sum of 1 (this should be zero); in position 2, count all of the times the sum is 2; in position 3, count all of the times the sum is 3, etc. Calculate the probability of getting the sum 12. How does this match with your simulation? What if you repeat the simulation more times? What about the sum of 7?

Scratch 3.0 is here!

Scratch 3.0, the latest version of the popular block-based programming language, it now available for all users!
Scratch 3.0 will work on both desktops and tablets alike, and has some exciting new blocks: you can make your characters speak out loud, and there is built in support for Makey Makeys!

Scratch was first developed over a decade ago at MIT, as has continued to be a leading resource for students looking to learn to write their own computer programs.


Tuesday, 18 December 2018

Hexaflexagons - back by popular demand!

We seem to have a holiday tradition of making hexaflexagons!

Here is a link to my favourite template for making tri-hexaflexagons:

Vi Hart's video about Hexaflexagons:

Wednesday, 5 December 2018

Hour of Code Activities

Here are some great activities from code.org especially for the Hour of Code:
These are some fun activities that use mazes:
For students who have done Hour of Code in past years, who like math, and who are looking for a real challenge:

Tuesday, 13 November 2018

On-line Math Games

These are some good on-line math games from websites other than Caribou Math.
These games are fun but won't work on a tablet because they need Flash or arrow keys:

Tuesday, 30 October 2018

Forces and Friction

What is a force?
What is friction?
Why do your hands warm up when you rub them together?

Simple Machines - Research Starring Point

With your group, using the links below as your starting point, prepare answers to the following questions to share with the class:
  1. What is the mechanical advantage of your simple machine? How does it make work easier?
  2. What is the cost of making that work easier?
  3. What are examples of your simple machine in everyday life?
  4. How could you include this simple machine in a Rube-Goldberg Machine?

Lever


Wedge

Pulley

Screw

Wheel and Axle
- Can you also find out about how the wheel and axle is like a lever?

Incline Plane
https://www.youtube.com/watch?v=5c4J_PW9wsg

Here is an overview of the classical simple machines:

Monday, 15 October 2018

Leaf Chromatography

In the autumn when leaves change colours, it is interesting to see if we can separate out all of the different colours that are found in leaves.

Here are some simple instructions for elementary school aged children to perform their own leaf chromatography experiment:

Tuesday, 2 October 2018

Potential and Kinetic Engergy

When making a Rube-Goldberg machine, it is important to remember to think about where the energy to keep your machine going will come from.

Learn about potential  and kinetic  energy:
Here's a explanation of elastic potential energy:
The force of friction will also be important to consider: