subject
Computers and Technology, 26.02.2021 18:10 caeley

Can you please look through this code and see wants wrong with it? its in python
# FirstFunction #
# #
# UTeach CSP #
# Brian Ford #
# edited by Shaun rigglelman #
# 11/12/19 #
# #


import random
import math

#this should Calculate your body mass index
def Calculate_BMI () :
name = input("Please type your name: ")
height = float(input("How many inches tall are you: "))
nheight = height / 39.37
weight = float(input("How much do you weigh (in pounds): "))
nweight = weight / 2.205
bmi = nweight / (nheight * nheight)
print(name + ", your BMI is " + str(bmi))

#this is an number game which you try and guess a number 1 to 100 it repeats until you guess right then it says the number of trys it took you
def number_game () :
count = 1
randnum = random. randint(1, 100)
print("I am thinking of a number between 1 and 100.")
guess = int(input("What number am I thinking of? "))
while guess != randnum:
if guess < randnum:
guess = int(input("Too low, guess again: "))
else:
guess = int(input("Too high, guess again: "))
count = count + 1
print("You guessed correctly, it took you " + str(count) + " tries.")

#this part of the program asks for your grades then askes what grade you will like then it does some math and tells you want grade you will need on your EOG (or EOC) final
def final_exam () :
mp1 = int(input("What was your grade for marking period 1? "))
mp2 = int(input("What was your grade for marking period 2? "))
grade = int(input("What grade would you like to have for your overall semester grade? "))
score = (grade - mp1 * 0.4 - mp2 * 0.4) / 0.2
print("You will need to score a " + str(score) + " on the final exam.")

#this last part is just a basic calculator like it says it only does adding, Subtracting, Multipling, and dividing
def calculator () :
num1 = float(input("Enter your first number: "))
num2 = float(input("Enter your second number: "))
operator = input("Which operation do you want to perform?\nAdd \nSubtract \nMultiply \nDivide\n")
if operator == "Add":
solution = num1 + num2
print("You answer is: " + str(solution))
elif operator == "Subtract":
solution = num1 - num2
print("You answer is: " + str(solution))
elif operator == "Multiply":
solution = num1 * num2
print("You answer is: " + str(solution))
elif operator == "Divide":
solution = num1 / num2
print("You answer is: " + str(solution))
else:
print("Incorrect math operation. Oof.")
else:
print("That is an incorrect option.")

choice = int(input("""Which of the following would you like to do? Type the number corresponding to the choice.
1) Calculate BMI
2) Play a Game
3) Final Exam - What do I need if...
4) Basic Calculator
"""))

if choice == 1:
Calculate_BMI
elif choice == 2:
number_game
elif choice == 3:
final_exam
elif choice == 4:
calculator

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 00:30
The best definition of an idiom is a. a word or phrase that describes a noun b. a word or phrase describing a verb c. a phrase containing figurative language in which the word expresses a different idea from its exact meaning d. a phrase that compares two unlike objects or ideas
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Do you think media is stereotype ? and why?
Answers: 1
question
Computers and Technology, 24.06.2019 15:50
Subscribe to j p g a m e t u b e on you tube ?
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
This isn't about school but every time it tells me to watch an ad to unlock the answer to a question it prompts a survey and it just keeps loading. so i haven't been able to get answers for my tests in like a week.
Answers: 2
You know the right answer?
Can you please look through this code and see wants wrong with it? its in python
# FirstFunc...
Questions
question
Mathematics, 21.08.2019 00:00
question
Mathematics, 21.08.2019 00:00
question
Mathematics, 21.08.2019 00:00
Questions on the website: 13722360