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
Which principle suggests that specific single responsibility interfaces are better than one general purpose interface?
ElenaW [278]

Answer:Interface segregation principle

Explanation: Interface-segregation principle (ISP) is amongst the major principles of the object-oriented design which describes that none of the users/clients can be forced for indulging and depending on the unknown methods or methods that they don't have knowledge about.

It functions by making the interfaces visible to the user that specifically fascinates them and keeping other smaller interfaces.Interfaces are made by splitting process and making the small interfaces from them.

8 0
3 years ago
Does Android have text-to-voice?
Licemer1 [7]
Yes but its nothing compared to apple
6 0
4 years ago
Q 1: How computer produces result?<br> Q 2: Write function of power supply in system unit?
oee [108]

The computer produces result as an Output,  by the central processing unit.

<h3>What are the function of power supply in system unit?</h3>

The key functions of a power supply unit are:

  • It helps to change AC to DC.
  • It transmit DC voltage to the motherboard, adapters, and others
  • It gives cooling and lead to more air flow via its case.

<h3>What is the result of the computer?</h3>

The result shown by a computer is known as an output, the result is known to be made by the central processing unit, that is said to be a computer's whole aim for existing.

Hence, The computer produces result as an Output,  by the central processing unit.

Learn more about computer from

brainly.com/question/24540334

#SPJ1

4 0
2 years ago
why might a portrait be both a portrait of the subject and the photographer? how is a photographer present in a portrait?
Nataliya [291]
Because of the reflection on the window or mirror.
5 0
3 years ago
Read 2 more answers
A chemical found in the synaptic vesicles , which , when released . has an effect on the next cell is called a?
ruslelena [56]
Neurotransmitters is the chemical found in the synaptic vesicles that, when released, has an effect on the next cell.
7 0
4 years ago
Other questions:
  • How many bits are required to address a 1mx8 main memory if main memory is byte addressable?
    6·1 answer
  • design the psuedocode for a program that allows a user to enter 10 numbers, then displays them in the reverse order of their ent
    6·1 answer
  • Import java.util.scanner; public class sumofmax { public double findmax(double num1, double num2) { double maxval; // note: if-e
    10·1 answer
  • What does the hard disk drive do?
    9·2 answers
  • What are the benefits of transferable skills check all the boxes that apply
    6·2 answers
  • EVERYONE PLS JOIN MY GOOGLE CLASSROOM<br> CODE: clmvjbd
    13·2 answers
  • Suppose that L is a sorted list of 1,000,000 elements. To determine whether the x item is in L, the average number of comparison
    14·1 answer
  • 71 81 77 15 63 96 36 51 77 18 17
    14·1 answer
  • In the graph shown here, by what percentage are the number of people in computer occupations in general projected to increase?
    10·2 answers
  • Iam trying to find a way to code in Scratch that will let me take away the first two and last two letters of a word. For example
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!