STEM Round 3

Black Snake (Lab Report)

The black snake experiment on Thursday the 7th, when like this. When we mixed 20g of sugar and 5g of baking soda together we got a solution of 2 food ingredients. We had a bowl cover with an aluminum foil of sand and we poured alcohol until it was wet and soak. We made a 2 thumbs size hole through the sand but not through the bowl and the aluminum. We poured all of the solutions to the hole, and we lighted the sand with some matches. We saw that the alcohol was burning with a blue and orange flame dancing around while the solution burning, turning to a mad black the outside, the inside colored a dark bronze and smelling burned because of the sugar. The texture looked rough with a fair hardness, but it felt very light like a piece of cotton, very soft like cotton and fragile like cotton candy. Overall it was fun to see the outcome.

The Rocky Candy

When we put the simplest food ingredients with the simplest liquid on Earth, we have an extremely delicious sweet rock candy. Boil the water at the temperature of 100 degree Celsius then pour table sugar into the boiling water. Stir it until it becomes thick and sticky close like ATM glue. The taste of it should be close to honey but not too sweet. Pour out the sweet water and put it into a clean glass. Put a stick with sugar table on it into the glass. Make sure the stick is straight and secure by using whatever that help the stick stand straight. 4 days to 7 days under the room temperature or less, you get your extremely delicious sweet rock candy. It happens like that because when the table sugar bonding dissolves with water bonding, it mixed up together and become a sweet liquid. The bonding in the liquid is just floating all around nothing to hold on. When we put the stick inside the sweet liquid, the bonding stick to the stick, become a hard crystal and the extremely delicious sweet rock candy.

Multimeadia Round 3

WHILE LOOP

my_name = 0
while my_name < 10:
    print "My name is Vutha."

I just wrote a while loop in python code to the computer to print “My name is Vutha” forever. While loop is one of the python code loop using to loop or perform the action until the condition is false. The structure of while loop looks like this:

...
while [condition]:
[action]
...

In my example, my_name = 0 is the variable. while my_name < 10:, while is the loop and my_name < 10: is the condition in a comparison between the value of my_name and an integer 10. Last print “My name is Vutha.” is the action. The computer reads the first line code and sees that my_name has the value equal to 0. The computer takes that value into the while loop and compares it with 10. 0 is less than 10, so the computer continues to read the next line which is the action in the while loop and the action has the value to print “My name is Vutha.” so the computer print:

My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.

FOREVER! It happens like that because of the value of my_name always has the value of 0 forever never change and the computer sees that 0 < 10 is always true never false. If we want the computer to print a certain amount of “My name is Vutha.” , we just need to have a new line of code that looks like this:

my_name = 0
while my_name < 10:
    print "My name is Vutha."
    my_name += 1

The computer reads the same everything until the last line of code in the while loop it updates the value of my_name + 1. Every time, the computer reads the code in the while loop, it updates the value of  my_name + 1 and when it updates the value until 10 it will not print  “My name is Vutha.” because 10 is not less than 10 so the condition is false. It should print the code like this:

My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.
My name is Vutha.

10 TIMES ONLY!

This code is also used while loop. It is a game. Try your best to understand the code!

print "*Please pick a number between 1 and 10. You have only 3 guesses. Try your best to win the game!"

random_number = randint(1, 10)

guesses = 0
while guesses < 3:
    guesses += 1
    number = input("Put a number: ")
    if random_number == number:
        print number, "is correct. You WIN!!! :)"
        break
    else:
        if guesses == 3:
            continue
        print number, "is incorrect. Please, try agian! :("
else:
    print number, "is incorrect. You lose. Game over. Better Luck Nextime! :-"