Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class in the project Lab1 called Lab1b. Write a program to produce the song output below: Create a class in the project Lab1
Create a class in the project Lab1 called Lab1b. Write a program to produce the song output below:
Create a class in the project Lab1 called Lab1b. Write a program to produce the song output below 5 bottles of beer on the wall 5 bottles of beer Take one down and pass it around 4 bottles of beer on the wall 4 bottles of beer on the wall 4 bottles of beer Take one down and pass it around 3 bottles of beer on the wall 3 bottles of beer on the wall 3 bottles of beer Take one down and pass it around 2 bottles of beer on the wal 2 bottles of beer on the wall 2 bottles of beer If one of those bottles should happen to fal 1 bottle of beer on the wall 1 bottle of beer on the wall 1 bottle of beer Take it down and pass it around No more bottles of beer on the wal Use print and println statements, but use method calls to reduce the number of repeated print and println statements. It's started for you here: / Lablb.java // This is a practice lab to output a few verses of "99 bottles of beer on Ithe wall" // Authors: Carol Zander,Clark,0lson, you public class Lablb t public static void main (String[] args) i int numBottles // number of bottles currently on the wall // display first verse numBottles = 5; System.out.print (numBottles) onWall ()i System.out.print (numBottles) botBeer takeOneDown numBottles = 4; System.out.print (numBottles) onWall ) System.out.println); // display blank line between verses // display second verse / (this is where you take overj public static void onWall) System.out-println(" bottles of beor on the wall") ; public static void botBeer) t System.out println (" bottles of beer" i Note that the last two verses have some subtle differences from th previous verses. When you successfully get output that matches the given output, raise your hand so I can check itStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started