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
Now try to use the following noun phrases in sentences of your own
mojhsa [17]

Answer:

Explanation:

The accused : He practically accused you of causing the accident

The first prize: I had the fortune to win the first prize in the speech contest.

Living in dark stables: Horses prefer living in dark stables.

Having to punish the kids: That punishment by depriving children of sweets only develops their greediness.

plz mark as brainliest

4 0
3 years ago
Write an application to the principal for three days leave ​
Inga [223]

Answer:

Respected Sir/Ma'am,

I Rohit Singh of class 7th from section A, wants to take your permission regarding the leaves on 11th, 12th and 13th November due to family functions. The functions are to be held in Agra and will be leaving on 10th November. Kindly grant me three days leave I will be very thankful to you.

Explanation:

5 0
3 years ago
Which listening barrier is interrupting effective communication in the example below? Garth was telling Monica about his weekend
Neporo4naja [7]

The correct answer is pseudo=listening. Monica pretends to listen what Garth is saying but she is not paying attention, instead on interacting with Garth she is only sayin "uh  huh". In this case Monica is focused on her cell phone which avoids to have an effective communication between her and Garth.

8 0
3 years ago
Explain the process of developing an informed opinion.
ludmilkaskok [199]

Explanation:

1 Reasoning: the drawing of inferences or conclusions from known or assumed facts; the use of reason. 2 Critical thinking: To evaluate and judge the accuracy of statements and the soundness of the reasoning that leads to conclusions.

6 0
3 years ago
Based on the facts presented in The Riddle of the Rosetta Stone, what is the most logical prediction that can be made about the
devlian [24]

Answer:Progress continued to be made in the years that followed.

Explanation: If this answer is correct, please give me brainliest :)

5 0
4 years ago
Read 2 more answers
Other questions:
  • PART A: Why is Mr. Winter's and Harriet's interaction at swim club significant to the story's plot? A Mr. Winter knows Harriet t
    14·1 answer
  • New words have been added to English over time _________________.
    7·1 answer
  • One possible reason that the revolutionary era poets use the _ meter was to imitate the _ style.
    15·2 answers
  • In the context of the communication process, _____ refers to putting a message into a written, verbal, or symbolic form that can
    13·1 answer
  • Which word is spelled correctly?<br><br> wiegh<br> concieve<br> kercheif<br> relieve
    6·2 answers
  • Hello, please help me fill in the blanks​ ​
    12·2 answers
  • Please Help Quick ASAP Hurry ASAP
    7·2 answers
  • My mother said to me,"Drive carefully!" change into indirect speech​
    14·1 answer
  • What is the connotative meaning of “monster”?
    7·1 answer
  • Three of the following statements are comma splices. Choose the one correctly punctuated statement that is not a comma splice.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!