You are on page 1of 1

CS 104 – Spring 2022

QUIZ 1 Solutions and Rubric:


1. (50 points) BMI (Body Mass Index) is a value derived from weight(kg) and
height(m) of a person to determine fatness. It’s formula is as follows:

Assign values 104 and 1.95 to variables weight and height, respectively. Write the
line of program that will calculate BMI using these two variables, and print the result
on the screen (you don’t need to calculate the output yourself)
Solution:
weight = 104
height = 1.95
BMI = weight / (height*height)
print(BMI)

2. (50 points) What are the errors in the following code? How can we fix them? Write
the correct code.
Print(3 + 4 * 5)
print(Hello World!”)

Solution:
print(3 + 4 * 5)
print(“Hello World!”)

You might also like