Am I being Rickrolled?
This task required me to code a program that checks the URL , so you don't get "Rickrolled." Rickrolling involves tricking someone into viewing Rick Astley's Never Gonna Give You Up music clip.
The code didn't involve too much but it was just making sure you had the right part of the URL that you are checking and have your else statement with "All Good" so that if the URL doesn't have it, it tells the user that it fine.
Eating in Circles
Eating in Circles, wasn't to complex coding but what you get stuck with is making sure you have the right mathematics. This whole program was mainly maths.
Import the math and ask the input question then the rest was multiplication division, squaring and rounding.
The maths -
c = (100 * day)
b = (c / math.pi)
a = (b * 0.5)
d = (math.sqrt(b))
e = (round(d))
The program was working out how many meters of rope you would need for Phar Lap for how many days you were going to leave him for.
Import the math and ask the input question then the rest was multiplication division, squaring and rounding.
The maths -
c = (100 * day)
b = (c / math.pi)
a = (b * 0.5)
d = (math.sqrt(b))
e = (round(d))
The program was working out how many meters of rope you would need for Phar Lap for how many days you were going to leave him for.
Marshmallows in a microwave
Part two - Marshmallows in a microwave was all about melting marshmallows in the microwave. Then they brought the maths into with speed = frequency x length. The program needed to ask
Megahertz of your microwave oven:
Metres between the melted marshmallows:
and use that data in the equation in which you had to convert integer into float so we get the exact result. The hardest bit in this part was to get the maths right with the float. The math -
c = float(meg) * 1000000 * float(met) * 2
c = float(c)
print ("c is approximately", c , "m/s")
Megahertz of your microwave oven:
Metres between the melted marshmallows:
and use that data in the equation in which you had to convert integer into float so we get the exact result. The hardest bit in this part was to get the maths right with the float. The math -
c = float(meg) * 1000000 * float(met) * 2
c = float(c)
print ("c is approximately", c , "m/s")