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]
3 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]3 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
How does the setting effect the plots
Sati [7]
The setting in literature is the place, the time, and the social situation in which a story takes place. The setting influences the plot, which includes the story's events. Certain actions are more likely to take place in specific environments. Also, the story's tone and theme rely on its setting.
6 0
3 years ago
What is the best way to punctuate the bolded portion of the sentence?
Svetllana [295]
The best way to punctuate the bolded portion of the sentence would be 

<span>“We have a problem;”    which is the 4th option.
</span>
This would make the complete sentence read as the following:


<span>Jill remarked, “We have a problem;" she went on to give details.</span>
5 0
3 years ago
Read 2 more answers
PLZZZZ HELPPPPPP
Tpy6a [65]

Answer:

In the first lines of the poem the speaker begins by creating several unusual and engaging phrases that state that things are “famous”. The first explains that the “river is famous to the fish”. This might take some analysis to figure out, but, it makes sense to consider the importance of the river in the life of a fish. It’s what they live in and very likely thinks about all the time. It’s the most important thing in their world.

The second “famous” line is different but not so much so that it isn’t related. This time, the speaker says that the “loud voice” is famous for the silence that it interrupts. After the first comparison, this one is easier. Without a “loud voice” the silence wouldn’t seem noteworthy. It needs to be interrupted to be noticed.

Nye uses personification and allusion in the next lines. She alludes to a line from the Bible, “the meek will inherit the earth” in order to cast “silence” in the same light. She is effectively saying that “silence” is meek, a human character trait given to something that’s not human. The silence knew, somehow, that it would inherit the earth long before it was written in the Bible.

Lines 5-9

   The cat sleeping on the fence is famous to the birds

   watching him from the birdhouse.

Explanation:

5 0
3 years ago
In regards to her children, Mrs. Bowles says, "I put up with them when they come home three days a month; it's not bad at all. Y
Karo-lina-s [1.5K]
Hahaheneurmrvsksnskdndnrir
7 0
3 years ago
Hey I need help with this. I posted one of these kind of questions earlier but here is another somewhat like it. I have written
hram777 [196]
It sounds like you thought out this question really well and really care about what you are doing, honey. 

One thing I would say is to restate and answer the question in the first sentence. That's just one of the things that teachers like to see.
 
One more thing that I just learned yesterday from my English teacher is that you can and take your "well" out to make the writing stronger.

I hope this helps. <3
3 0
4 years ago
Other questions:
  • Which sentence is a correct example of an in text citation
    6·2 answers
  • Theme is an important element in Their eyes were Watching God. Which of these is one of those themes?
    13·2 answers
  • We shall have to marshal support for this proposal if we want to gather enough votes to have it discussed in the committee.
    9·1 answer
  • Define persistence ​
    8·2 answers
  • Why do we need information
    6·2 answers
  • NEED HELP DUE TODAY PLZ HELP ME I AM STUCK PLZ PLZ PLZ HELP ME!!!!
    14·1 answer
  • Which two statements most accurately describe a tragic drama
    14·1 answer
  • A: Ice cream is unhealthy.
    13·1 answer
  • Which characteristics of archetypes best describe<br> Antigone?
    13·1 answer
  • Jessica _____________ airplanes every month and ________________ car.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!