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
Tpy6a [65]
3 years ago
6

Squares. Write a program class named SquareDisplay that asks the user for a positive integer no greater than 15. The program sho

uld then display a square on the screen using the character ‘X’. The number entered by the user will be the length of each side of the square. For example, if the user enters 5, the program should display the following:
XXXXX
XXXXX
XXXXX
XXXXX
XXXXX
INPUT and PROMPTS. The program prompts for an integer as follows: "Enter an integer in the range of 1-15: ".

OUTPUT. The output should be a square of X characters as described above.

CLASS NAMES. Your program class should be called SquareDisplay
Computers and Technology
1 answer:
Nana76 [90]3 years ago
8 0

Answer:

import java.util.Scanner;

class SquareDisplay {

 public static void main(String[] args) {

   Scanner scan = new Scanner(System.in);

   System.out.print("Enter an integer in the range of 1-15: ");

   int num = scan.nextInt();

   if ((num > 0) && (num <= 15)) {

     String s = "X".repeat(num) + "\n";

     System.out.print(s.repeat(num));

   } else {

     // your error handling

   }

   scan.close();

 }

}

Explanation:

You might be interested in
Como puedo poner fondo a mi teclado​
nikdorinn [45]

CAN YOU TRANSLATE IT TO ENGLISH PLEASE SO I CAN AWANSER

7 0
3 years ago
Which term describes an event where a person who does not have the required clearance or access caveats comes into possession of
notka56 [123]

Answer:

The answer is "compromise"

Explanation:

In computer science, the comprised system is used to describe as any technological resource, that has been negatively affected by an untrustworthy source for nondisclosure, integrity or accessibility either deliberately or inadvertently.

  • In this, the mechanical interaction from the unauthorized source or technological progress can result in compromise.
  • This helps you and the partner to meet each other's interests by taking into consideration both the positions and the solution to the main problem.

4 0
3 years ago
Read 2 more answers
Need help with this programming question plz!
nignag [31]

Answer:

d. X ==2

Explanation:

It is a Boolean Expression so == means equal to.

I had to review my Relational Operators/ Conditional Operators, lol.

7 0
3 years ago
Select the correct answer.
Marina86 [1]
C: pie chart is the answer to it
4 0
3 years ago
Read 2 more answers
To change the overall design of an entire document to include colors, fonts, and effects, a user should apply a _____.
Olenka [21]
User should apply a theme.

Hope this helps!
8 0
3 years ago
Read 2 more answers
Other questions:
  • To delete a note, select the note reference mark in the footnote text by dragging through the note reference mark, and then clic
    6·1 answer
  • What kind of graph or chart does this image represent?
    15·2 answers
  • In what way, if any, are colleges and universities related?
    14·1 answer
  • to print a range of cells in the active worksheet click blank in the settings area in the print gallery
    9·2 answers
  • You don't have policies that force settings for the look of users' computer desktops. Each user's chosen desktop settings are ap
    15·2 answers
  • When troubleshooting firewalls, you should never attempt to repeat the problem because you could do more damage. T/F
    6·1 answer
  • If an engineer wants to verify changes that she has been making on a router, which commands will allow her to check the routers
    15·1 answer
  • Why entity relationship model is used for data manipulation??<br><br>​
    15·1 answer
  • A hardware component that keeps data and information when the device is not powered is called a ____ device.
    11·1 answer
  • Which ipconfig command switch would a technician use to display detailed information (such as dns servers and mac addresses)?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!