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, 22.06.2019 08:30
Linda subscribes to a cloud service. the service provider hosts the cloud infrastructure and delivers computing resources over the internet.what cloud model is linda using
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
This graph compares the total cost of attending educational institutions in texas. the graph demonstrates that the cost at private and public technical schools greatly varies.
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
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, 27.09.2019 07:00