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
What do you understand by structured programmingapproach? Also Discuss about bottom up and top down approach.
mart [117]

Answer:

Structured programming also known as Modular programming in which the program is made as a single structure.The execution is instruction by instruction.It mainly focuses on improving the quality,clarity and development time of a computer program.

The top-down approach works by breaking a complex algorithm into smaller parts called modules. The modules keep breaking until there is no space left for breaking them without hindering the originality.The breaking of the modules is prohibited after achieving a certain level of modularity . C language uses this approach.

Bottom up works exactly opposite of how the top-down approach works.This approach works in the most elemental level of solving a problem and going up with combination of several parts of the solution to achieve required results.

4 0
3 years ago
Question 1(Multiple Choice Worth 5 points)
vlabodo [156]

Answer:

Information assurance

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, etc.

Information assurance is a broad category that is typically used by cybersecurity or network experts to protect sensitive user information such as passwords, keys, emails, etc., in both digital and hard-copy forms

6 0
3 years ago
To format an individual sparkline, select the sparkline you want to format, and then click the Ungroup button in the Group group
vichka [17]

Answer:

The answer is "Option a"

Explanation:

A Sparkline is a small graph, which is available inside a sheet, that displays information visually. It displays the information is in the form of patterns on several values. It also uses underline to display the low and high value, use with sparklines, and certain alternatives were wrong, which can be defined as follows:

  • In option b, It is used to define the overall view of data, that's why it is wrong.
  • Option c and Option d both are wrong because, create command is used to create data, or view is used to show that data, they both don't use sparkline option.  
3 0
3 years ago
Absolute time would be most similar to :
Luda [366]
The absolute time would be most similar to a fact. It was theorised and in fact, approved by scientists as a scientific law which governs, according to Wikipedia, as a "<span>true and mathematical </span>time<span>, of itself, and from its own nature flows equably without regard to anything external, and by another name is called duration: relative, apparent and common </span><span>time."</span>
3 0
3 years ago
What is the process called that occurs when you start up your computer? A Download B Restore C Boot D Copy
inn [45]
Starting up your computer can also be referred to as "booting up" therefore, the answer is c
8 0
3 years ago
Read 2 more answers
Other questions:
  • An email can lead to miscommunication because:
    6·2 answers
  • Write a Java program that prompts the user to enter a sequence of non-negative numbers (0 or more), storing them in an ArrayList
    5·1 answer
  • In order to do a binary search on an array Group of answer choices you must first do a sequential search to be sure the element
    5·1 answer
  • In general, font size for software-generated presentation slides should be no smaller than __________ points.
    8·1 answer
  • Which of the following statements describes a good reason to use lossless audio compression?
    6·1 answer
  • You are given 6 training examples for a binary classification problem as follows:
    12·1 answer
  • what version of the internet do we use as an interactive social system in which users are able to interact with senders
    7·1 answer
  • What will happen when you drag and drop a worksheet tab into another workbook WITHOUT holding the Ctrl key down?
    13·2 answers
  • Which line of code will find the first occurrence of a three in an array?
    5·2 answers
  • Examine the following output:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!