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
What technology changes led to industrialization?
qwelly [4]
Factors, also this is the wrong place to post this question
7 0
3 years ago
This uses the gps methodology to predict the likely location of an offender's base of operation:
iVinArrow [24]
Crime pattern analysis <span>uses the gps methodology to predict the likely location of an offender's base of operation.</span>
6 0
3 years ago
Kurtz &amp; Kemeny created an easy-to-learn programming language called?
vampirchik [111]

BASIC

(Beginners' All-purpose Symbolic Instruction Code)

4 0
3 years ago
Drag the tiles to the correct boxes to compete the pairs.
levacccp [35]

Provides the fescription of a grammar error = Explain

Changes all occurrences of the misspelled words = Change all

Change the behavior of the grammar checker = Options

Enables you to add or remove misspelled words = Replace


3 0
3 years ago
Read 2 more answers
You are hired as a security advisor to the software development team at ABC corporation. The team aims to develop a new electron
Sergeeva-Olga [200]

Answer:

✓ The best and most correct answer among the choices provided by the question is the second choice. Recent advancements in productivity software technology

Explanation:

Productivity software has been used for a number of years. Recent advancements in productivity software technology have made _____ among multiple users all over th…

✓ The best and most correct answer among the choices provided by the question is the second choice. Recent advancements in productivity software techn…

See more

7 0
3 years ago
Other questions:
  • Which of the following is NOT a group on the Slide Master tab?
    6·1 answer
  • I damaged a k12 laptop. do I have to pay for the damage? and if so how much?
    5·1 answer
  • The default primary key for an access database is the id field true or falser
    7·1 answer
  • Is Windows a:<br><br> A.operating system<br> B.software<br> C.hardware<br> D.input device
    12·1 answer
  • What is a series of instructions or commands that a computer follows used to create software
    9·1 answer
  • Explain briefly why you cannot expect to find a previous version of every file with which you work.
    10·2 answers
  • PLEASE HELP!!!
    12·1 answer
  • Describe ONE similarity and ONE difference between the use of lighting in candid and posed photography.
    15·1 answer
  • For robot arms the first three axes are called
    6·1 answer
  • Cidr simplifies how routers and other network devices need to think about the parts of an ip address, but it also allows for mor
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!