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
An implicit detail is a
valentinak56 [21]

Answer:

The correct response is "Hint or suggestion". A further explanation is given below.

Explanation:

  • The interpretation of the given context refers to something that can be presumed as well as suspected, but never explicitly mentioned.  
  • Therefore this would be implicit because it's not explicitly mentioned but which is whether indicated in the language and perhaps required for the intent to be carried out.  

So the interpretation above would be right.

6 0
3 years ago
What is the difference between a topic sentence and a thesis statement?
icang [17]

Answer:

A topic sentence comes at the beginning of each paragraph and tells what that specific paragraph will be about. A thesis statement usually comes at the end of the first paragraph in an essay and tells what the rest of the paper will be about.

5 0
2 years ago
Read 2 more answers
25
cestrela7 [59]
Hey I only answered cause I need help so bye
4 0
3 years ago
Has anyone ever read "Anything men can do, I can do bleeding."? if so what's the purpose?
jarptica [38.1K]
Big humuguss ballssqck
5 0
2 years ago
Who says this: "What mean you, foolish girl? Dost thou deem it misery to be endowed with marvelous gifts, against which no power
Anika [276]

Answer:

Rappaccini said these lines.

Explanation:

Nathaniel Hawthorne's short story "Rappaccini's daughter" tells the story of a scientist Giacomo Rappaccini who selfishly kept his daughter Beatrice confined with him in his experimentation with poisonous plants. Along the way, she also became poisonous for other people, herself being immune to the poison of the plants.

Beatrice had began to love a young man named Giovanni, but is fatal for him. She wants to be with him but hadn't realized that he had also became just like her. The excerpt is from when Rappaccini asked her why she claimed to be miserable when she had been endowed with something that no one else has. He could not understand why Beatrice wants to be like a "<em>weak woman, exposed to all evil, and capable of none</em>". According to him, he had given her the greatest gift of being able to withstand any poison but can be destructive over others, whereas she wants to be like other women who can love openly and be like them.

6 0
3 years ago
Other questions:
  • What literary tool is Mark Twain using when he humorously describes the conflict between the new, well-dressed boy and Tom to re
    10·2 answers
  • Which sentence best supports the inference that the narrator's mother had been hoping to spend a day with her daughter before sh
    15·2 answers
  • The Outsiders: How did the fire at the church start?
    6·2 answers
  • 2. The increase in population nationwide has had the following effect on driving habits:
    15·1 answer
  • 1 Point
    9·2 answers
  • Theme is not __________.
    12·2 answers
  • Read this excerpt from We Beat the Street.
    9·2 answers
  • Which line of poetry is written in iambic pentameter?
    6·2 answers
  • Why does Anderson repeat the phrase “ten circles to the left/right” throughout Chapter IX?
    8·2 answers
  • What is the meaning of Friends ?​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!