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
How many possible password of length four to eight symbols can be formed using English alphabets both upper and lower case (A-Z
Fynjy0 [20]

Answer:

In a password, symbol/characters can be repeated. first calculate the total

symbols which can be used in a password.

So there are total 26(A-Z),26(a-z),10(0-9) and 2(_,$) symbols.

that is equal to 26+26+10+2=64.

Total number of password of length 4:

here at each place can filled in total number of symbols i.e 64 way for each

place.Then total number of possible password is:

64*64*64*64=16777216

Total number of password of length 5:

here at each place can filled in total number of symbols i.e 64 way for each

place.Then total number of possible password is:

64*64*64*64*64=1073741824

Similarly,

Total number of password of length 6:

64*64*64*64*64*64=68719476736

Total number of password of length 7:

64*64*64*64*64*64*64=4398046511104

Total number of password of length 8:

64*64*64*64*64*64*64=281474976710656

Hence the total number of password possible is:285,942,833,217,536

7 0
3 years ago
What are the required components of a database function? ​
vagabundo [1.1K]

Answer:

Following are the required components of a database function :-

  • Software
  • Data
  • Hardware
  • Procedures
  • Data Manager
  • Database Access language
  • Query processor

hope it helps!

5 0
3 years ago
Trish has bought a new computer, which she plans to start working on after a week. Since Trish has not used computers in the pas
Nikolay [14]

Answer:

The answer is C

Explanation

She should sign an annual maintenance contract (AMC) with her vendor

3 0
3 years ago
Read 2 more answers
Which of the following need NOT be completed separately if a worksheet is prepared?
Anika [276]
C because you already have you sheet prepared
3 0
3 years ago
Which two security regulations does the PCI enforce with regard to electronic banking?
Sever21 [200]

The two security regulations the PCI enforce in regards to electronic banking are an external Qualified Security Assessor (QSA) or by a firm specific Internal Security Assessor that creates a Report on Compliance for organizations handling large volumes of transactions, or by Self-Assessment Questionnaire (SAQ) for companies handling smaller volumes.

5 0
3 years ago
Read 2 more answers
Other questions:
  • System Architecture: Describe the system architecture. Specifically, be sure to address the corporate organization and culture,
    10·1 answer
  • TLO 06 Active Directory Domain and Trusts tool is used to move servers between site in an AD Infrastructure.a. Trueb. False
    14·1 answer
  • A small company has hired you to take over its IT needs. The company currently has seven on-site employees and 12 remote employe
    12·1 answer
  • Definition of powerpoint animation
    14·1 answer
  • Tuklasin<br>awain 2: Grapiko ng Pananagutan<br>Isulat sa graphic organizer pa​
    9·1 answer
  • Describe how a cell’s content and format attributes are related.
    13·2 answers
  • I ONLY HAVE 5 MIN HELPPPPPP
    15·2 answers
  • 1. Write the full forms of the following.
    8·2 answers
  • A customer dictates instruction on how to transcribe audio. Do you have to transcribe the instruction word for word?
    13·1 answer
  • Suppose in an Excel spreadsheet, the value in cell A1 is 25. By using the Macabacus local currency cycle shortcuts (Ctrl + Shift
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!