Question

From 1925 through 1963, Burma Shave advertising signs appeared next to highways all across the United States. There were always four or five signs in a row containing pieces of a rhyme, followed by a final sign that read “Burma Shave.” For example, one set of signs that has been preserved by the Smithsonian Institution reads as follows:

Shaving brushes

You'll soon see 'em

On a shelf

In some museum

Burma Shave

Write, compile, and test a class that outputs five lines so that each displays one line of this Burma Shave slogan in turn.

///What's wrong with this code? It says that does not display the correct output? This was my answer:///

X Programming Exercise 1-12 BurmaShave.java Terminal Instructions 1 mport javax.swing.JOptionPane; 2 class Burnashave From 19

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student,

You cannot display a message box in an online compiler. So you have to program for console application.

Please find the below code:

public class Main
{
   public static void main(String[] args) {
       System.out.println("Shaving brushes\nYou'll soon see'em\nOn a Shelf\nIn some museum\nBurma Shave");
   }
}

Explanation:

You have to use System.out.println() to print in console application. and all the online compilers are of console application

Screenshot of output:

1 public class Main 2 public static void main(String[] args) { System.out.println(Shaving brushes\nYou11 so 3 T seeem\nOn

If you have any doubt please comment below for clarification also please don't forget to hit the thumbs up button Thank you :)

Add a comment
Know the answer?
Add Answer to:
From 1925 through 1963, Burma Shave advertising signs appeared next to highways all across the United...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT