Write a program that displays a menu where the user can select weight, distance, and temperature conversions:

A. Convert pounds to kilos
B. Convert kilos to pounds
C. Convert kilometers to miles
D. Convert miles to kilometers
E. Convert Celsius to Fahrenheit
F. Convert Fahrenheit to Celsius
G. Exit

The user will input one option, and the program will ask the user for an amount.

Answer :

Here's a Python program that displays a menu for weight, distance, and temperature conversions based on the user's selection:

def pounds_to_kilos(pounds):

return pounds * 0.45359237

def kilos_to_pounds(kilos):

return kilos * 2.20462262

def kilometers_to_miles(kilometers):

return kilometers * 0.62137119

def miles_to_kilometers(miles):

return miles * 1.609344

def celsius_to_fahrenheit(celsius):

return celsius * 9/5 + 32

def fahrenheit_to_celsius(fahrenheit):

return (fahrenheit - 32) * 5/9

def display_menu():

print("Conversion Menu:")

print("A - Convert pounds to kilos")

print("B - Convert kilos to pounds")

print("C - Convert kilometers to miles")

print("D - Convert miles to kilometers")

print("E - Convert Celsius to Fahrenheit")

print("F - Convert Fahrenheit to Celsius")

print("G - Exit")

def get_user_input():

option = input("Select an option: ")

return option.upper()

def get_amount():

amount = float(input("Enter the amount: "))

return amount

def convert(option, amount):

if option == "A":

result = pounds_to_kilos(amount)

print(f"{amount} pounds is equal to {result} kilos")

elif option == "B":

result = kilos_to_pounds(amount)

print(f"{amount} kilos is equal to {result} pounds")

elif option == "C":

result = kilometers_to_miles(amount)

print(f"{amount} kilometers is equal to {result} miles")

elif option == "D":

result = miles_to_kilometers(amount)

print(f"{amount} miles is equal to {result} kilometers")

elif option == "E":

result = celsius_to_fahrenheit(amount)

print(f"{amount} Celsius is equal to {result} Fahrenheit")

elif option == "F":

result = fahrenheit_to_celsius(amount)

print(f"{amount} Fahrenheit is equal to {result} Celsius")

elif option == "G":

print("Exiting...")

return False

else:

print("Invalid option. Please try again.")

return True

def main():

running = True

while running:

display_menu()

option = get_user_input()

amount = get_amount()

running = convert(option, amount)

if __name__ == "__main__":

main()

This program allows the user to select a conversion option from the menu (A-G) and enter an amount to convert. Based on the user's input, the corresponding conversion function is called, and the result is displayed. The program will continue to prompt for conversions until the user selects "G" to exit.Note: This program assumes valid user input and does not include extensive error handling.

To learn more about temperature click on the link below:

brainly.com/question/30122350

#SPJ11