Ask Question
7 June, 04:29

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.

+4
Answers (1)
  1. 7 June, 07:36
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers