This one is designed to be more beginner friendly. If you're confused on how to do something, just ask me!
You can earn points by submitting solutions for any of the problems, so don't worry about finishing all of them if you can't yet.
Please create a separate file for each problem you submit to Google Classroom.
Contestant | Problem 00 | Problem 01 | Problem 02 | Problem 03 | Problem 04 |
---|---|---|---|---|---|
Jack Donofrio | N/A | N/A | N/A | N/A | N/A |
Jon Jazwinski | 1/1 | 2/2 | N/A | N/A | N/A |
Samir Rajani | 1/1 | 2/2 | 3/3 | 4/4 | 4/5 |
Write a program that prints "My first submission!" to standard output.
Write a program that prints "Hello, {name}!" where {name} is your name.
- Example: "Hello, Jack!"
Write a program that calculates the volume of a cone with a radius of 5 and a height of 9.
Write a program that converts 40 degrees Celsius to degrees Fahrenheit.
Hint
F = C * 9/5 + 32Write a program that computes the roots of x2 + 16x + 52 = 0.
Hint 1
Two rational roots exist.Hint 2
The quadratic equation might helpHint 3
https://imgur.com/pjyy2l6print("My first submission!")
Suitable:
print("Hello, Jack!")
But this is better:
name = "Jack"
print(f"Hello, {name}!")
PI = 3.14159
radius = 5
height = 9
volume = 1 / 3 * radius * radius * height * PI
print(volume)
or
import math
radius = 5
height = 9
volume = 1 / 3 * pow(radius, 2) * height * math.pi
print(f"volume = {volume}")
c = 40
f = c * 9/5 + 32
print(f"{c} degrees Celsius is {f} degrees Fahrenheit")
import math
# x^2 + 16x + 52 = 0
# a^2 + bx + c form
a = 1
b = 16
c = 52
root_1 = (-b + math.sqrt(b*b - 4*a*c)) / (2*a)
root_2 = (-b - math.sqrt(b*b - 4*a*c)) / (2*a)
print(root_1, root_2)
Alternatively
import math
a = 1
b = 16
c = 52
discriminant = b*b - 4*a*c
root_1 = (-b + math.sqrt(discriminant)) / (2*a)
root_2 = (-b - math.sqrt(discriminant)) / (2*a)
print(root_1,root_2)