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
Who is the main character (protagonist) in the hero’s journey
gregori [183]

Answer:

The Hero is the protagonist of a story. The Hero represents our own struggles, obstacles and triumphs

Explanation:

4 0
4 years ago
Read 2 more answers
HELP MEEE ASAP THANK YOU &lt;333333
Mnenie [13.5K]
It’s C (if this one is wrong then I’m sorry)
4 0
3 years ago
Read 2 more answers
In addition to size, what other characteristic of the hispanic market has drawn advertisers? a. easy to persuade b. station loya
Lelu [443]

(B.) Station Loyalty, is the characteristic of the Hispanic market has drawn advertisers.

In loyalty program they maintain ones loyalty by encouraging referrals, creating a point system, partnering with other companies, sets up a subscription service and even ask for feedback.

“Hispanic” comes from the Latin term for Spanish,"Hispanicus" the ancient Romans called the Iberian Peninsula Hispania. In the 19th century, the term “Hispano” was used to describe people descended from Spaniards in United States.

It is so because Hispanic marketing is a strategy/way to lure the advertisers and customers. The loyalty program is designed/build to encourage repeat business even luring/offering people with rewards as the consumers stays loyal to the brand/market.

To learn more about Hispanic market here

brainly.com/question/14826277

#SPJ4

5 0
2 years ago
Identify the gerund phrase.<br> I remember going to see<br> old cowboy movies.
eimsori [14]

Answer: I think it is cowboy but I am not sure

Explanation:

3 0
3 years ago
Propose four measures you can implement during this challenging academic year to keep your mental health in check​
Elden [556K]

Explanation:

bsmabakamaffdssedr4ffffffsss

3 0
3 years ago
Other questions:
  • Select the correct text in the passage.
    10·1 answer
  • 1.jetta and jim wrangled over their veiws of free trade. Netta and him expressed deferent views on free trade. 3. netta and jim
    10·1 answer
  • How do Laune's parents respond to his stories about Charles's behavior in school?​
    8·1 answer
  • What is the main idea of the book in dawn of the doughnut​
    13·1 answer
  • What does the black desert ants diet consist of
    11·2 answers
  • Sometimes at work I put my feelings ahead of those of other people
    12·1 answer
  • Thoughts on Biden inauguration ?
    15·1 answer
  • A complete soil profile includes three layers—
    8·2 answers
  • How do you believe that the emotion of fear can be addressed in your personal life? Describe in detail two or more strategies th
    7·1 answer
  • The main reason why The Adventures of Huckleberry Finn is controversial today is because
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!