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
How has society changed over time?<br> I really need help with this question it's for an essay
Ilia_Sergeevich [38]
Society now a days are all in technology 
4 0
2 years ago
What’s the past tense and past participle of the word burn?
mr_godi [17]
 It is Burned add ed for past tense
4 0
3 years ago
4. In which lines of the poem does Paul Revere learn that the British are marching by
astraxan [27]
A.) lines 6-9

If the British march
By land or sea from the town to-night,
Hang a lantern aloft in the belfry-arch
Of the North-Church-tower, as a signal-light, —
One if by land, and two if by sea;
7 0
3 years ago
Read 2 more answers
Write a short response to the following question: Do you agree with Mack’s argument? Why or why not? Why Read Shakesphere
jolli1 [7]

Answer:

Yes, I agree with Mack's argument because he was able to clarify and give enough evidence on how reading Shakespeare is similar to that of studying the real world and our own selves. It also emphasizes the integrity of the heart and mind and how such unity makes a person understand and become educated.

Explanation:

The question above is related to Michael Mack's argument <em>"Why Read Shakespeare?" </em>He provided evidence regarding the good side of reading the works of Shakespeare. For him, although <u>reading Shakespeare's works may seem hard at the start, reading it over and over again will allow the person to grasp its true meaning.</u> He also compared it to that of studying different courses in college and learning to play a particular music.

3 0
3 years ago
Eyy i need help pleas.
Diano4ka-milaya [45]

Answer:

what do you need help on ????

6 0
3 years ago
Read 2 more answers
Other questions:
  • I need evidence from the book where does that say Plz Help Me or what page ?
    10·1 answer
  • One important theme that is understood through a close reading of The Adventures of Huckleberry Finn is... Traveling together ma
    15·2 answers
  • What is the appositive in this sentence? P.L. Travers's book Mary Poppins was recommended to me by the librarian. A. was recomme
    13·2 answers
  • An effective conclusion to an informational text should (5 points)
    13·1 answer
  • What can you infer about Macbeth's mental state from his reaction to his<br> wife's death?
    8·1 answer
  • In what point of view should an analytical essay be written?
    10·2 answers
  • GUYS HELP IM FAILING ENGLISH ILL MARK BRAINLIEST IF YOU HELP PLEASE
    14·1 answer
  • He tried with all his might.<br> Change the sentence Into Adverb Phrase :-:::: pls answer oof
    6·1 answer
  • Hint it's not ONE of the answers already marked
    7·1 answer
  • How did social media play a role in the inspiration and organization of the Nashville protest? Answer the question in 4-5 senten
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!