1. Write a personalized BMI calculator in the form of a function called bmi_calculator(). This function prompts the user for their appelation, their first name, their last name, their height in inches, their weight in pounds, and prints a message of the form:
BMI Record for _APPELATION _FIRSTNAME _LASTNAME:
Subject is _X feet _Y inches tall and weighs _Z pounds.
The subject's BMI is _B.
(The words preceded by _ are replaced with the input provided by the user.) Your solution must use a function call to bmi function from question 5.
answer for q5
def bmi(w, h):
return ( (w /(h * h)) * 703 )
on python
'''
Python version : 2.7
Python program to prompt user for their appelation, their first name, their last name, their height in inches, their weight in pounds
and print message stating their bmi index
'''
# function that calculates and returns the bmi for passed weight, w and height, h
def bmi(w, h):
return ( (w /(h * h)) * 703 )
# main function that prompts the user for information, then calls bmi to calculate and display the bmi index
def bmi_calculator():
appelation = raw_input(' Appelation : ')
fname = raw_input(' First name : ')
lname = raw_input(' Last name : ')
height = float(raw_input(' Height(in inches) : '))
weight = float(raw_input(' Weight(in pounds) : '))
print(' BMI Record for %s %s %s' %(appelation,fname,lname))
height_feet = int(height*0.0833333)
height_inches = height - (height_feet*12)
print(' Subject is %d feet %f inches tall and weighs %f pounds' %(height_feet,height_inches,weight))
print(" The subject's BMI is %f" %(bmi(weight,height)))
# call the main function
if __name__ == "__main__":
bmi_calculator()
#end of program
Code Screenshot:
Output:
1. Write a personalized BMI calculator in the form of a function called bmi_calculator(). This function prompts...
Please write this code in C++ Object-Oriented Programming, specify which files are .h, and .cpp, and please add comments for the whole code. Include a class diagrams, and explain the approach you used for the project and how you implemented that, briefly in a few sentences. Please note the following: -Names chosen for classes, functions, and variables should effectively convey the purpose and meaning of the named entity. - Code duplication should be avoided by factoring out common code into...
You will be writing a simple Java program that implements an ancient form of encryption known as a substitution cipher or a Caesar cipher (after Julius Caesar, who reportedly used it to send messages to his armies) or a shift cipher. In a Caesar cipher, the letters in a message are replaced by the letters of a "shifted" alphabet. So for example if we had a shift of 3 we might have the following replacements: Original alphabet: A B C...