With this activity, you will find out what is your weight on the various planets of the Solar System.
You will do this by coding with a real programming language: Scratch. In the end, you can share your program so that anyone can use it, even older people, who will have fun discovering how much comforting it could be to weigh themselves on Mars, rather than on Jupiter 😛
Let’s start by downloading the pictures of the planets, which will become our sprites: an image for each planet. In order to do this, click on the image with the left mouse button: an enlarged version of the planet will open. At this point, click with the right mouse button on the enlarged image and save it in your workbook. The name of each image corresponds to the name of the planet (with the PNG extension). They are all real images, taken from NASA or ESA satellites.
At this point, you can start coding with Scratch. If you did not install Scratch on your computer, you can program directly from the Mit platform. Create a new program and, first of all, import a new sprite for each planet (using the images you just downloaded).
By importing the planets, you will see that they all have the same dimensions on the stage. If we want to create a Solar System with (at least) correctly scaled dimensions, we can reduce the size of all the planets compared to Jupiter, which is the largest, keeping it as it is. We can do the size-scaling of all the planets as following:
- the diameter of Mercury is 3% the one of Jupiter
- the diameter of Venus is 8% the one of Jupiter
- the diameter of the Earth is 9% the one of Jupiter
- the diameter of Mars is 5% the one of Jupiter
- the diameter of Saturn is 84% the one of Jupiter
- the diameter of Uranus is 36% the one of Jupiter
- the diameter of Neptune is 35% the one of Jupiter
In order to make them smaller, just go in the sprite size box and put that percentage number shown in bold, like this:
Once you have loaded and reduced all the sprites, arrange them as you wish within the stages. This code will only be representative of the dimensions (to scale) of the planets, not of their distance or position. At this point, select your character (the kitten or any sprite you prefer). Eventually rename and customize it as you like. First, our character will ask us how much we weigh on Earth. This is the right time to use a scale to find out! When we have found out, we will write the piece of code which make us this question, and memorize our response.
From the Events commands panel, take the “When the green flag clicked” command and drag it into the script area. Then, in the Sensing panel, take the “Ask” command and go to write the question “How much do you weigh on Earth?” within the command itself. So:
Create a new variable (for all sprites) called “weight on Earth” and bring it to the value of the “answer” that you can find in Sensing. Attack the command “set weight on Earth to answer” under the blue command containing the question.
Now we are in the most complicated part of the program. When you click on the sprite of a planet, you have to calculate the weight we would have if we weighed ourselves on the other planets of the Solar System. Subsequently, a cartoon will communicate the weight.
Let’s start from Mercury, selecting the planet sprite. On Events, we take the command “when this sprite clicked”. In Looks, take the command “say … for 2 seconds”. Then we have to build the sentence with our weight on Mercury, calculated by using the multiplicative operator. We can find the commands we need in Operators:
First of all, we should calculate the product between our weight on Earth and a number which depends on the gravity force of each planet, compared to Earth. These numbers are:
- the force of gravity on Mercury is 0.38 times the one on Earth
- the force of gravity on Venus is 0.91 times the one on Earth
- the force of gravity on Mars is 0.38 times the one on Earth (yes, like that on Mercury)
- the force of gravity on Jupiter is 2.36 times the one on Earth (I would have said more, given how big it is)
- the gravitational force on Saturn is 0.92 times the one on Earth (on the other hand it would float in a swimming pool)
- the gravitational force on Uranus is 0.89 times the one on Earth
- the force of gravity on Neptune is 1.14 times the one on Earth
We can round the resulting number up using the “round” command. Then we use the “Join” command and we compose the answer, going to fit each piece in its place. Do it so:
We should do the same for each planet, by clicking on the sprite corresponding to each planet and inserting the right number (and changing the name of the planet, of course). In the end, when you click on the green flag, after entering your weight, you can click on each planet of the Solar System in order to find out how much you would weigh over there!
Do you also want to insert the Moon? Try it for yourself! Keep in mind that on the Moon we would weigh 1/6 of our weight on Earth 😉
You can customize the code as you prefer… if you want to see some examples made by other children, go to the project folder where you can also add yours: How much do you weigh in the solar system?
(translation from Italian by Silvia Casu)