Question: Use print and println statements, but use method calls to reduce the number of repeated print and println statements. Seed code is provided as

Use "print" and "println" statements, but use method calls to reduce the

Use "print" and "println" statements, but use method calls to reduce the number of repeated "print" and "println" statements. Seed code is provided as follows: // Lab1b.java // This is a practice lab to output a few verses of //"99 bottles of beer on the wall" // Authors: Carol Zander, Clark Olson, you public class Lab1b { } public static void main (string[] args) { int numBottles; // number of bottles currently on the wall // display first verse numBottles = 5; System.out.print(numBottles); onwall(); } 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 over] } public static void onwall() { system.out.println(" bottles of beer on the wall"); public static void botBeer() { System.out.println(" bottles of beer"); Note: The last two verses have some subtle differences from the previous verses.

Step by Step Solution

3.38 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Option A is correct Since S... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!