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
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