Square Box to print only frame from existing project in asteriks when width and legth are entered.
$10-30 USD
Dokončeno
Zveřejněno před více než 9 roky
$10-30 USD
Zaplaceno při doručení
This would print out:
*****
*****
*****
*****
I need it to print out:
*****
* *
* *
*****
So basically just a frame.
import [login to view URL];
public class SquareBox
{
public static void main(String args[])
{
String widthString;
String heightString;
int width;
int height;
int row;
int column;
widthString = [login to view URL]("Please enter the width of the rectangle");
width = [login to view URL](widthString);
heightString = [login to view URL]("Please enter the height of the rectangle");
height = [login to view URL](heightString);
// Outer Loop for Rows
row = 1;
while(row <= height)
{
// Inner Loop for Columns
column = 1;
row++;
while (column <= width)
{
[login to view URL]("*");
column++;
}
[login to view URL]();
}
}
}