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]
1 year ago
14

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

Computers and Technology
1 answer:
Naily [24]1 year 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
Typically, a programmer develops a programâs logic, writes the code, and ____ the program, receiving a list of syntax errors.
miv72 [106K]
"debugs" is the answer
4 0
3 years ago
Which of the following describes the term "false information?"
pav-90 [236]
Inaccurate and misleading
3 0
3 years ago
Magbigay ng tatlong hanap buhay na makukuha sa mineral produktong galing sa dagat at produktong agrikultural
OLEGan [10]
..............................................nice !
7 0
3 years ago
Read 2 more answers
True or false: you should reuse passwords on multiple websites because it will help you remember those passwords
Fudgin [204]

Answer: False

Explanation: Even though you can remember it is not really good because some hackers can track you passwords through those websites and could hack your account.

3 0
2 years ago
Read 2 more answers
How do you get past a firewall ?
DaniilM [7]
Use a Web-based Proxy. ...
Use a VPN. ...
Use Remote Access to Your Own PC. ...
Kill the Blocking Service. ...
Use Mobile Data as a Stopgap. ...
What if You're Using a Phone? ...
Sneaky Like a Boss.
3 0
3 years ago
Other questions:
  • What technological innovation was the key factor driving the booming economy?
    8·1 answer
  • In scratch the location of a sprite is defined by what?
    10·1 answer
  • A client contacted you to request your help in researching and supplying the hardware necessary to implement a SOHO solution at
    9·1 answer
  • The Coins class was created to hold all your loose change, kind of like a piggy bank! For this exercise, you are going to simula
    15·1 answer
  • A port is the point at which a peripheral device attaches to or communicates with a computer or mobile device. True False
    15·1 answer
  • S.B. manages the website for the student union at Bridger College in Bozeman, Montana. The student union provides daily activiti
    7·1 answer
  • How do you create a formula in excel​
    10·1 answer
  • Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a pr
    10·1 answer
  • Which online note-taking device allows students to clip a page from a website and reuse it later?
    13·2 answers
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!