Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
bartleby

Concept explainers

bartleby

Videos

Question
100%
Book Icon
Chapter 7, Problem 5PE
Program Plan Intro

Print message corresponding to Body Mass Index (BMI)

Program plan:

  • Define the function “Body_MI()”
    • Calculate BMI value from the weight and height.
    • Return the BMI value to the calling function.
  • Define the function “main()”,
    • Get the weight and height of the user using “input()” method.
    • Assign the value return from “Body_MI()” function to “b_mi”.
    • Check whether the value of “b_mi” is lies between “19” and “25” using “if” statement.
      • If it is true, print message as “You are within the arbitrary healthy range”.
        • Otherwise, Check whether the value of “b_mi” is less than “19” using “elif” statement,
          • If it is true, then print a message as “You are below the arbitrary healthy range.”.
        • Otherwise, Check whether the value of “b_mi” is greater than “25” using “elif” statement,
          • If it is true, print a message as “You are above the arbitrary healthy range.”.
        • Otherwise, print the message as “Please enter a valid height and weight”.
  • Call the function “main()”.

Blurred answer
Students have asked these similar questions
Java Language The company will held its quarterly performance for each department; wherein each group of the department are rated from 1 to 5, where 1 is the lowest score and 5 is the highest score. The department has two groups, groupA and groupB. Each group will be rated by five evaluators. Create a program that will ask for the input rate of the evaluators, and determine the group that got the highest rating, as well as the overall rating of the department. Use the UML diagram below as a reference. Department() – accepts 5 ratings of the evaluators and determines the groupScore which is the total rating of the group. getGroupAverage() – returns the value of groupAverage which is the average score of the group. displayAverage() – displays the overAllAverage which is the average of the whole department. overAllScore is the over all score of the department. Department Group Score: Int Group Average : Double Overall Score: int overall Average: double Department()…
A business law class of 25 students takes a midterm exam that has 100 true- or-false questions. The instructor, who is also a computer fanatic, wants to devise a program to obtain a printout with the student's name, score, and letter grade, according to the following schedule: 50 or below F 51 - 55 D 56 – 60 C- 61 - 65 66 – 70 C+ 71 - 75 B- 76 - 80 81 - 85 86 – 90 B B+ А- 91 - 95 A 96 – 100 A+ In addition, the instructor wants to include the total number of students scoring each of the 11 possible grades. How would you use the FORTRAN language to solve his problem?
Answer this question Write a program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight for his or her height. A person’s BMI is calculated with the following formula:BMI = weight × 703 / height2where weight is measured in pounds and height is measured in inches. The program should display a message indicating whether the person has optimal weight, is underweight, or is overweight. A sedentary person’s weight is considered to be optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is considered to be underweight. If the BMI value is greater than 25, the person is considered to be overweight
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY