Commit 7ca365e 1 parent 3e03c67 commit 7ca365e Copy full SHA for 7ca365e
File tree 2 files changed +12
-13
lines changed
2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 1
- # Program to calculate the Body Mass Index
1
+ # Program to calculate class standing from the number of credits earned
2
2
3
3
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: " ))
7
5
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" )
15
14
16
15
main ()
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ def main():
9
9
bmi = (720 * weight ) / height ** 2
10
10
11
11
print ("Your BMI is" , bmi )
12
- if bmi >= 19 :
12
+ if bmi < 19 :
13
13
print ("That's on the low side." )
14
- elif bmi < 25 :
14
+ elif bmi <= 25 :
15
15
print ("That's in the healthy range." )
16
16
else :
17
17
print ("That's on the high side." )
You can’t perform that action at this time.
0 commit comments