1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Galina-37 [17]
2 years ago
14

Write a program that converts a decimal height in feet into feet and inches.

Computers and Technology
1 answer:
Naily [24]2 years ago
4 0

The program to illustrate the conversion of the height is illustrated below.

<h3>How to illustrate the program?</h3>

The information here is to convert 1 inch = 2.54 cm. First, we will take user input of height in cm. We first convert this to inches by dividing by 2.54

After that, we use Floor Division // and Modulo % by 12 to get feet and inches respectively.

The inches will be in a lot of decimals. We round this off to 2 decimal places and finally print out the converted height.

The code will be:

# Take user input for height in cm

height_cm = float(input("Enter your height in cm: "))

# Convert height to inches

height_in = height_cm / 2.54

# Get feet by taking floor division with 12

feet = height_in // 12

# Get inches by taking modulo division with 12

inches = height_in % 12

# Round off the inches to 2 decimal places

inches_rounded = format(inches, ".2f")

# Print out the height in feet and inches

print(f"Height is {feet} ft {inches_rounded} in")

Learn more about program on:

brainly.com/question/26134656

#SPJ1

You might be interested in
A report has a column of totals, with each total adding to the cell above it. What kind of calculated figure is this?
Alexxx [7]

ANSWER:

The correct answer is Running Sum.

Explanation:

A report has a column of totals, with each total adding to the cell above it. Such type of calculated figure is called the Running Sum.

Running sum is also called the Partial Sum. In such type of summation, the values in the sequence is added to get a final result and then if a new number comes, it is again added to the grand sum, and in this way the sequence continues. Every new entry is added to the previous sum to get another sum.

3 0
3 years ago
When assembling a desktop computer you should always install the drives before the motherboard?
s2008m [1.1K]
Yes you should install drives first
8 0
3 years ago
What is network hardware?
vovangra [49]
Modem, router, switch, server, etc. these are hardware meant to facilitate the transfer or storage of remote information.
8 0
3 years ago
If you wish to include a header or footer on all pages in a publication, you will need to insert this by navigating to the _____
Marina86 [1]
If you wish to include a header or footer on all pages in a publication, you will need to insert this by navigation to the master page.
7 0
3 years ago
Read 2 more answers
Isa wants to find out if his co-worker Alexis is available for an event on Wednesday, February 10th. Which calendar
Elena-2011 [213]
Appoint view
Hope this helps
7 0
3 years ago
Other questions:
  • What type of elements are bridges exposed to yearly
    13·2 answers
  • When a person or organization uses the services of another professional, that person or organization is called the _______
    15·1 answer
  • The number of pixels displayed on the screen is known as ________.
    13·1 answer
  • In a Microsoft Office application, what is the area at the bottom of the application screen that contains information about the
    13·1 answer
  • What is an example of CT SO?
    9·1 answer
  • Two types of formulas in Excel, what are they? A. Complex and simple, B. General and currency, C. Logical and Boolean, D. Trig a
    15·1 answer
  • what is example of application of machine learning that can be imposed in eduction. (except brainly.)
    9·1 answer
  • Which of the following statements is FALSE?
    5·1 answer
  • What is the main purpose of a web crawling program
    15·1 answer
  • What color pixels are used in a camera?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!