1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DaniilM [7]
3 years ago
15

1. Write an application that prompts the user to enter the size of the side of a square, and then displays a hollow square of th

at size made of asterisks. Your program should work for squares of all side lengths between 1 and 20. This is a sample run of your program: Enter·the·size·of·the·asterisk·square·from·1-20:3↵ ***↵ *·*↵ ***↵
Computers and Technology
1 answer:
belka [17]3 years ago
4 0

Answer:

import java.util.Scanner;

public class HollowSquare

{

public static void main(String args[])

{

Scanner scan = new Scanner(System.in);

int size;

System.out.print("Enter the size : ");

size = scan.nextInt();

if(size>=1 && size<=20)

{

for(int i=0; i<size; i++)

{

for(int j=0; j<size; j++)

{

if(i==0 || j==0 || i==size-1 || j==size-1)

System.out.print("*");

else

System.out.print(" ");

}

System.out.println();

}

}

else

System.out.println("Invalid size.");

}

}

You might be interested in
Mathematics and modern technology​
coldgirl [10]

Answer:

where is the question ???? breh

6 0
3 years ago
What does the Sort feature do with a database
WARRIOR [948]
Nothing. If you SELECT data from a database, and add an ORDER BY clause, it just affects the ordering of the data that is returned to the user, but the data in the database remains unaltered.
6 0
4 years ago
Rules used by a computer network<br> A network protocol <br> B hierchary protocal<br> C procedure
maria [59]

Answer:

The answer is B hierchary protocal

4 0
3 years ago
Which generation experienced a generation gap?
Alex_Xolod [135]

Answer:

B. Baby boomers (the boom generation)

Explanation:

They went against everything their parents said. Also I took a test on it and got it right.

7 0
3 years ago
6. assume there are three small caches, each consisting of four one-word blocks. one cache is fully associative, a second is two
sveticcg [70]

Answer:

Question: Assume there are three small caches, each consisting of four one word blocks. One cache is direct-mapped, a second is two-way set-associative, and the third is fully associative

Explanation:

Question: Assume there are three small caches, each consisting of four one word blocks. One cache is direct-mapped, a second is two-way set-associative, and the third is fully associative

6 0
2 years ago
Other questions:
  • "what do you perform when you want to recall specific records from a database"
    13·1 answer
  • How old do you have to be to get paid to wave at liberty tax in Abilene tx
    8·2 answers
  • Sometimes, fourth-generation languages (4GLs) are called procedural languages
    9·1 answer
  • Help me out here pleaseeeee
    9·2 answers
  • Write a program which reads in a single integer 0 &lt;= n &lt; 30 and prints out the factorial of n. Factorials get very big ver
    9·2 answers
  • A(n) ______ page is the page on a website that a visitor sees when he or she clicks a link from an ad, a search engine result, o
    6·1 answer
  • Short Questions: a) What is website? How can we browse internet using website?​
    9·1 answer
  • Six security issues and six descriptions are shown below.
    11·1 answer
  • It is important to consider the quality of the data being used when considering the accuracy of a conclusion. Incorrectly collec
    11·2 answers
  • Hey how was your day 50 points
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!