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
Wstaw czasownik w odpowiedniej formie
Bumek [7]

Answer:

1. She <u>doesn't go</u> (not/go) to school on Mondays.

2. They <u>were</u> (be) late 2 weeks ago.

3. <u>Do you go</u> (you/go) to London every Summer holidays?

4. I <u>am playing</u> (play) football now.

5. They <u>don't watch</u> (not/watch) tv on Mondays.

6. <u>Does he cut</u> (he/cut) the grass every Friday?

7. She <u>is not finishing</u> (not/finish) the test at present.

8.<u> Was she </u>(she/be) angry yesterday?

9. <u>Are we cooking</u> (we/cook) dinner now?

10. You <u>don't do</u> (not/do) homework every day.

11. She <u>wasn't</u> (not/be) at school yesterday.

12. She<u> is </u>(be) Polish.

13. A cat <u>drinks</u> (drink) milk every day.

14. He <u>likes</u> (like) drinking orange juice.

15. We <u>weren't </u>(not/be) at school 2 days ago.

Explanation:

Note that we usually decide which verb form to use according to time expressions given in the sentence.

For instance, time expressions such as <em>every summer holiday, on Monday, every Friday, every day</em> indicate that we are talking about a repeated action/habit and that the tense we need to use in these sentences is present simple tense. On the other hand, if we have time expressions such as <em>now, at present, at the moment</em>, we need to use present continuous tense. Expressions such as<em> yesterday, two days ago, 2 weeks ago </em>require past simple tense, etc.

5 0
3 years ago
What does it mean when the article says "The native<br> way was scorned and discouraged."?
Basile [38]

Explanation:

It means that the native way has experienced discourage from others and no respect. It means that people from the same culture were rejected or we can also say ignored in this case.

Scorned is the word that means ignored. The person who is scorn means that he does not have respect for others and for what they are thinking, it means also that the person is disliking something and does not approve of it.

In this case it would mean that people from the same culture and nation have experienced rejection.

6 0
3 years ago
According to defoe, the real reason men have denied women the advantages of an education is that men —
navik [9.2K]
Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions here.

According to defoe, the real reason men have denied women the advantages of an education is that men <span>fear the competition from women . the answer is A. 

</span>
6 0
3 years ago
Read 2 more answers
( I Really Truly Need Help ASAP I'm Stuck On This Assignment). Read the following prompt. Consider the speakers in " The Charge
liq [111]

Answer:

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj bruh

Explanation:

4 0
3 years ago
Complete the text with the Last simple or past continuos of the verbo in Brackett. 1. Martin is a fashion blogger. While he (stu
Ugo [173]

Answer:

studies and decides are the correct answers

6 0
3 years ago
Other questions:
  • Summarize the role of Juliet in acts 3, 4, and 5 of Romeo and Juliet
    5·1 answer
  • BRAINLIESTTT AAP!!
    15·1 answer
  • When clothes tag says size xs/tp, what does the tp mean?
    12·2 answers
  • What is the purpose of the repetition Mandje mandje in the story The Fishermen and His Wife
    12·1 answer
  • One regulation the Federal Reserve imposes on banks is that they guarantee a portion of their money be available for their depos
    15·1 answer
  • EASY POINTS! Which sentence is correct?
    12·1 answer
  • Can anyone help me with these questions:
    8·2 answers
  • Can something positive result from a seemingly negative experience?<br> Answer
    13·1 answer
  • Help :( I’ll give brainliest, question 2
    7·1 answer
  • Which confirming message communicates the highest form of value?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!