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
AleksAgata [21]
3 years ago
8

(Display four patterns using loops) Ask the user to enter an integer to

Computers and Technology
1 answer:
fomenos3 years ago
4 0

Answer:

Hi There was small mistake. It is working fine for me. When you run from command line - use LoopPattern, not looppatern

import java.util.Scanner;

public class Looppattern {

  public static void main(String[] args) {

      Scanner sc = new Scanner(System.in);

      System.out.println("Enter how man levels you need: ");

      int levels = sc.nextInt();

      System.out.println("\n---------------Pattern A-----------------\n");

      for (int p = 1; p <= levels; p++) {

          for (int k = 1; k <= p; k++) { // increasing each level printing

              System.out.print(k);

          }

          System.out.println();

      }

      System.out.println("\n---------------Pattern B-----------------\n");

      int r = levels;

      for (int p = 1; p <= levels; p++) {

          for (int k = 1; k <= r; k++) {

              System.out.print(k);

          }

          r--; // decreasing levels

          System.out.println();

      }

      System.out.println("\n---------------Pattern C-----------------\n");

      for (int p = 1; p <= levels; p++) { // here incresing

          for (int k = p; k > 0; k--) { // and here decreasing pattern to

                                          // achieve our required pattern

              System.out.print(k);

          }

          System.out.println();

      }

      System.out.println("\n---------------Pattern D-----------------\n");

      r = levels;

      for (int p = 1; p <= levels; p++) {

          for (int k = 1; k <= r; k++) {

              System.out.print(k);

          }

          r--; // decreasing levels

          System.out.println();

      }

  }

}

Explanation:

You might be interested in
In the belt drive mechanism, what happens when the belt is crossed instead of open?
KengaRu [80]
They will spin in the opposite direction because the belts are twisted.
8 0
3 years ago
Similarities between human and computer​
Zielflug [23.3K]

Answer: Both have a center for knowledge; motherboard and brain. Both have a way of translating messages to an action. Both have a way of creating and sending messages to different parts of the system.

5 0
3 years ago
What kind of software would you recommend a company use if its employees are receiving e-mails that are potentially hazardous ?
scZoUnD [109]

Answer:

Microsoft project

Explanation:

I'm smart

6 0
3 years ago
Lower range tones generally require ________ speakers. lower range tones generally require ________ speakers. multiple choice
lilavasa [31]

Lower range tones generally require larger speakers.

It's no secret that lower range tones generally require larger speakers. This is because lower frequencies have longer wavelengths, and thus require more physical space to produce.

While this may seem like a simple concept, there are a few things to keep in mind when it comes to speaker size and low frequency response. First, larger speakers can usually reproduce lower frequencies more efficiently than smaller ones. Second, the size of the speaker's enclosure also plays a role in how well it can reproduce low frequencies.

A larger enclosure will typically have an easier time reproducing low frequencies than a smaller one.

Keep these things in mind when selecting speakers for your system. If you're looking for accurate low frequency reproduction, make sure to choose speakers with larger drivers and enclosures.

Learn more on speakers here:

brainly.com/question/14649463

#SPJ4

6 0
1 year ago
In Microsoft Word, when you highlight existing text you want to replace, you're in 
umka2103 [35]

Answer:

i honestly believe that its type over mode, hope it helps

Explanation:

6 0
3 years ago
Other questions:
  • The function takes two string parameters; the first is the name of a file and the second is text. Complete the function to appen
    7·1 answer
  • Jason is working on a project that requires him to manage a huge amount of data. The spreadsheet he is working on has data relat
    12·1 answer
  • Who is typically considered to be the father of computing
    6·1 answer
  • To use
    11·1 answer
  • The __________ statement allows you to check for
    7·1 answer
  • What is a cpu in full explanation?
    7·2 answers
  • I don't get the width and height part (PLEASE HELP WILL GIVE BRAINLIEST ANSWER)
    12·1 answer
  • Who Is faster sonic or flash well it all depends on which version of sonic your talking about like for example video game sonic,
    14·1 answer
  • WHATS YALL FAVORITE GAME WHOEVER GIVES THE BEST ANSWER WINS 200
    13·2 answers
  • 12. What are the additional elements required of a network architecture if the enclave is to support remote access through the p
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!