Skip to content

Commit 7ca365e

Browse files
committed
Revert "Finished ex 7.5"
This reverts commit 3e03c67.
1 parent 3e03c67 commit 7ca365e

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

7.4.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# Program to calculate the Body Mass Index
1+
# Program to calculate class standing from the number of credits earned
22

33
def main():
4-
weight = float(input("Enter your weight in pounds: "))
5-
height = float(input("Enter your height in inches: "))
6-
bmi = round(weight * 720 / height**2, 1)
4+
credits = int(input("Enter the number of your credits: "))
75

8-
print("Your BMI is: ", bmi)
9-
if bmi <= 25:
10-
print("That's healthy!")
11-
elif bmi < 19:
12-
print("Watch out! That's unhealthy")
13-
else:
14-
print("Watch out! That's unhealthy")
6+
if credits < 7:
7+
print("You're a Freshman")
8+
elif credits >= 7:
9+
print("You're a Sophomore")
10+
elif credits >= 16:
11+
print("You're a Junior")
12+
elif credits >= 26:
13+
print("You're a Senior")
1514

1615
main()

code/chapter07/c07ex05.py

100755100644
+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def main():
99
bmi = (720 * weight) / height**2
1010

1111
print("Your BMI is", bmi)
12-
if bmi >= 19:
12+
if bmi < 19:
1313
print("That's on the low side.")
14-
elif bmi < 25:
14+
elif bmi <= 25:
1515
print("That's in the healthy range.")
1616
else:
1717
print("That's on the high side.")

0 commit comments

Comments
 (0)