Ask Question
22 March, 21:18

Write a program that prompts the user to enter the weight of a person in kilograms and outputs the equivalent weight in pounds. output both the weights rounded to two decimal places. (note that 1 kilogram equals 2.2 pounds.) format your output with two decimal places.

+2
Answers (1)
  1. 22 March, 22:47
    0
    I wrote this program in Python:

    x = int (input ("Enter Weight in Kilograms: "))

    result = x*2.2

    print ("Your weight in Kilograms is: ","{0:.2f}". format (x), "/nYour weight in Pounds is: ","{0:.2f}". format (result))

    In Python programming the value of 'x' even though it is in the INT format, will still allow the program to get the decimal places.

    The "results" will simply return the full float of the inputted value. The addition of the "{0:.2f}. format (variable) " is used to limit the number of decimal places that will be displayed.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program that prompts the user to enter the weight of a person in kilograms and outputs the equivalent weight in pounds. output both ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers