Question: Java Program that prints a hollow box using Asterisks for the even-numbered lines and @ sign for the odd-numbered lines. Need help with the loops

Java Program that prints a hollow box using Asterisks for the even-numbered lines and @ sign for the odd-numbered lines.

Need help with the loops and conditionals to make the hollow box alternate between * and @ on the even and odd lines:

import java.util.Scanner;

public class FigurePrinter { public static void main(String args[]){ Scanner s = new Scanner(System. in ); System.out.print("Height of your box: "); int h = s.nextInt();

System.out.print("Width of your box: "); int w = s.nextInt(); printFig(h, w);

}

static void printFig(int w, int h) { } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!