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
Sidana [21]
2 years ago
8

Write a java program that prompts the user to input a length expressed in centimeters. The program should then convert the lengt

h to inches (to the nearest inch) and output the length expressed in yards, feet, and inches, in that order (all three formats). For example, suppose the input for centimeters is 312. To the nearest inch, 312 centimeters is equal to 123 inches. So 123 inches would then be output as 3 yards, 1 foot, and 3 inches It should not output as: 2 yards, 4 feet and 3 inches = 10 feet, 3 inches = 10.25 feet.
English
1 answer:
lilavasa [31]2 years ago
7 0

The program is an illustration of a sequential program

<h3>What are sequential programs?</h3>

Sequential programs are programs that do not require loop or iteration

<h3>The main program</h3>

The program written in Java, where comments are used to explain each line is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 //This creates a Scanner object

 Scanner input = new Scanner(System.in);

 //This prompts the user for length in cm

 System.out.print("Length (cm): ");

 //This gets the input for length

 int lengthCM = input.nextInt();

 //This converts the length to inches

 int lengthInches = (int)(Math.round(lengthCM/2.54));

 //This converts the length to yards

 int lengthYard = lengthInches/36;

 //This converts the remaining length to feet

 int lengthFeet = (lengthInches -36 * lengthYard)/12;

 //This calculates the remaining inches

 lengthInches = lengthInches - lengthYard * 36 - lengthFeet * 12;

 //This prints the required output

 System.out.print(lengthYard+" yards, "+lengthFeet+" feet and "+lengthInches+" inches");

}

}

Read more about sequential programs at:

brainly.com/question/17970226

You might be interested in
What is the main theme and idea of the poem "Cetacean" by Peter Reading
monitta

Answer:

early Sunday morning and his companions set out to see the whales

3 0
3 years ago
What is endearing about Sally Ride’s tone in “Single Room, Earth View”?
blondinia [14]
<h2><u>Answer:</u></h2>

From perusing this story, I discovered that attempting to depict a plane ride to somebody who has never flown is exceptionally hard. You can't generally depict space travel to somebody who has never done it. It's difficult to depict, and she really expounds on how stunning everything looks from a space transport. That is one thing Sally truly stresses.

That likewise indicates she was full with wonder. I additionally discovered that "development's progressively grievous consequences for the earth" are the negative parts of human effect on the world, similar to contamination and oil slicks.

3 0
3 years ago
Read 2 more answers
!!HURRY I DONT HAVE MUCH TIME!! Brainstorm some ideas for a “hook” for your essay. (it’s over online schooling , i’m against it)
Vitek1552 [10]

Answer:

Have you ever attended a meeting online for a max time of one hour and thought it was realy bkring and hard to concentrate? now multiply that by 9. That is how online students everyday feel doing online school. I think that school should be done face to face because first...(and there you put your reason 1 and 2)

3 0
3 years ago
Please identify the characteristics of both cyber-bullying and in-person bullying
tia_tia [17]

Answer:

Both are degrading people and purposely being malicious to them

8 0
3 years ago
Read 2 more answers
What does an ode typically address?
valina [46]
An ode typically addresses something to be praised or glorified.

As a result, an ode can address anything beautiful or great: a person, place, event, or even a thing (as in Ode On A Grecian Urn). Basically, an ode addresses anything the poet considers worthy of praise.
7 0
3 years ago
Other questions:
  • Why are these lines from Act III important in the plot of the play?
    7·1 answer
  • Which conclusion can you draw about the passage based on the verbs you highlighted?
    14·2 answers
  • Out of the eight (8) elements that make up acronym flourish, identify at least 5 of the elements you use daily. Explain the sign
    10·1 answer
  • How long has poole worked for dr jekyll
    8·1 answer
  • Write a few sentences about how you spend your time during the week. Use as many different quantifiers as you can.
    11·1 answer
  • This is for economics can someone help
    9·2 answers
  • What is romance and what is love​
    12·2 answers
  • It is a fault that will RIGHT itself. The underlined word is a/an :
    12·1 answer
  • Which is an appropriate claim for the following writing prompt?
    15·1 answer
  • Autumn eveningâ€" there’s joy also in loneliness. â€"Buson What is the kigo in this haiku? "evening" "joy" "loneliness" "autum
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!