Answer:
height = float(input("Enter your height in m: "))
weight = float(input("Enter your weight in kg: "))
BMI = weight / (height/100)**2
print(f"You BMI is {BMI}")
Explanation:
The python code for calculating BMI is as follows -
height = float(input("Enter your height in m: "))
weight = float(input("Enter your weight in kg: "))
BMI = weight / (height/100)**2
print(f"You BMI is {BMI}")
Some conditions can also be added such as
if BMI <= 15:
print("You are underweight.")
elif BMI <= 30:
print("You are healthy.")
elif BMI <= 40:
print("You are over weight.")
Andy is working on a project to build an accounting software program for his firm. He uses old programming modules that contained code to perform various processes and links them to create a complete system. Which approach does he apply to the program design?
A.
structured programming
B.
non-structured programming
C.
top-down approach
D.
bottom-up approach
E.
modular programming
Answer:
E. modular programming
Explanation:
Andy is applying a design known as modular programming. This is basically a design in which the entire project is broken down into various parts known as modules. Each one of these modules performs a very different and unique task. As the modules are created they are linked together like pieces of a puzzle in order to form the entire project. This makes tackling a large project much easier and makes debugging problems much easier as well.
edhesive assignment 2: room area?
Explanation:
a, b, c, d, e = input("A ="), input("B ="), input('C = '), input("D = "), input('E = ')
print(float(a*b + sqrt(c**2-(a/2)**2) * a/2 * 0.5))
a, b, c, d, e = input("A ="), input("B ="), input('C = '), input("D = "), input('E = ') print(float(a*b + sqrt(c**2-(a/2)**2) * a/2 * 0.5))
What is program?The program is an illustration of functions. Functions are groups of code segments that are executed when called or evoked
The calendar program
The calendar program in Python, where comments are used to explain each line is as follows:
#This checks for leap year
def leap_year(y):
if y % 4 == 0:
return 1 else return 0
#This returns the number of days in the month
def number_of_days(m,y):
if m == 2:
return 28 + leap_year(y)
elif m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m ==10 or m == 12:
return 31
elif m == 4 or m == 6 or m == 9 or m == 11:
return 30
#This returns the number of days left in the month
def days(m,d):
dayList = [0,31,59,90,120,151,181,212,243,273,304,334]
return dayList[m-1] + d
#This returns the number of days left in the year
def days_left(d,m,y):
if days(m,d) <= 60:
return 365 - days(m,d) + leap_year(y) else:
return 365 - days(m,d)
#The main begins here
#This next three lines gets input for date
day=int(input("Day: "))
month=int(input("Month: "))
year=int(input("Year: "))
#This gets the choice from the user
menu=int(input("Press 1 to calculate the number of days in the given month.\nPress 2 to calculate the number of days left in the given year.\nChoice: "))
#This prints the number of days in the month
if menu == 1:
print(number_of_days(month, year))
#This prints the number of days left in the year
elif menu == 2:
print(days_left(day,month,year))
Read more about Python functions at:
brainly.com/question/14284563
#SPJ7
The complete part of the question will be:
Assignment 3: Chatbot
What the code for assignment 3: chatbot Edhesive.
You are designing an ecommerce web application that will scale to hundreds of thousands of concurrent users. Which database technology is best suited to hold the session state in this example
Answer: Amazon DynamoDB
Explanation:
The database technology that is best suited to hold the session state in this example is the Amazon DynamoDB.
Amazon DynamoDB is a document database which helps in delivering high quality and fast cperformance at any scale. It can be used to scale to hundreds of thousands of concurrent users as it's multi-active, and has a durable database that has built-in security.