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
Nataliya [291]
3 years ago
15

How should I do it Please code for Java

Computers and Technology
1 answer:
andrew-mc [135]3 years ago
3 0

Answer:

class Main {  

 public static void printPattern( int count, int... arr) {

     for (int i : arr) {

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

           System.out.printf("%d ", i);

       System.out.println();

     }

     System.out.println("------------------");

 }

 public static void main(String args[]) {

   printPattern(4, 1,2,4);

   printPattern(4, 2,3,4);

   printPattern(5, 5,4,3);

 }

}

Explanation:

Above is a compact implementation.

You might be interested in
In Java code, the line that begins with/* and ends with*/ is known as?​​​​​​​​​​​​​​​​​​​
Rainbow [258]

Answer:

It is known as comment.

6 0
4 years ago
You use the same five shell functions every day and are looking for a way to ensure they are available as soon as you log into y
ANTONII [103]

Answer:

.c. Load them via your login script.

Explanation:

Given that using functions in shell scripts enhances programming output and login script comprises the functions and statements required to effectively execute at any given time the user logs into their account.

Hence the moment these functions are formulated, they are then executed through a single command statement thereby reducing the time of re-writing another set of code repeatedly in every program.

Therefore, in this case, what you can do is to "Load them via your login script."

4 0
3 years ago
Which of these social news sites promotes itself as supporting free speech and will remove videos with self-harm or that feature
LUCKY_DIMON [66]

Fark is the social news sites promotes itself as supporting free speech and will remove videos with self-harm or that feature racist or violent content.

<h3>Describe Fark.</h3>

A daily batch of news stories and other material from many websites are posted to the community website Fark, which was developed by Drew Curtis. The website receives a lot of story submissions every day, and about 100 of them are publicly shown on the site, spread out throughout the home page, and have many topical tabs (arranged as business, sports, geek, entertainment, and geek). Although Curtis claims there is no political bias in the selection of the tales, he does try to publish both far-left and far-right material.

As popularity and engagement increased, more features like forums and link submissions were added. The main goal of the makeover was to make the site more user-friendly and intuitive. Fark is the a news social networking site that promote itself as supporting free speech and will remove videos with self-harm or that feature racist or violent content.

To learn more about social networking sites, visit:

brainly.com/question/13307340

#SPJ1

5 0
1 year ago
Which supercontinent is thought to have formed about 1 billion years ago and to have included most of Earth's land masses?
riadik2000 [5.3K]
C (Pangaea)

Dinosaurs lived on Pangaea
7 0
3 years ago
Create an array of that size and then prompt the user for numbers to fill each position in the array. When all of the positions
andreyandreev [35.5K]

Answer:

In Java

import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

     Scanner input = new Scanner(System.in);

     int arrsize;

     System.out.print("Please enter the number of digits to be stored: ");

     arrsize = input.nextInt();

     int[] myarr = new int[arrsize];

     for (int kount = 0; kount < arrsize; kount++) {

        System.out.print("Enter integer: ");

        myarr[kount] = input.nextInt();      }

     System.out.println("The contents of your array:\nNumber of digits in array: "+arrsize);

     System.out.print("Digits in array: ");

     for (int kount = 0; kount < arrsize; kount++) {

        System.out.print(myarr[kount]+" ");      }

  }

}

Explanation:

This declares the length of the array

     int arrsize;

This prompts the user for the array length

     System.out.print("Please enter the number of digits to be stored: ");

This gets the input for array length

     arrsize = input.nextInt();

This declares the array

     int[] myarr = new int[arrsize];

The following iteration gets input for the array elements

<em>      for (int kount = 0; kount < arrsize; kount++) { </em>

<em>         System.out.print("Enter integer: "); </em>

<em>         myarr[kount] = input.nextInt();      } </em>

This prints the header and the number of digits

     System.out.println("The contents of your array:\nNumber of digits in array: "+arrsize);

     System.out.print("Digits in array: ");

The following iteration prints the array elements

<em>      for (int kount = 0; kount < arrsize; kount++) { </em>

<em>         System.out.print(myarr[kount]+" ");      }</em>

4 0
3 years ago
Other questions:
  • Assume s is a string of lower case characters.
    15·1 answer
  • 6. The NADH and FADH2 produced during the Krebs cycle pass their electrons down the 7. __ __ __ __ __ __ __ __ __ __ __ __ __ __
    6·1 answer
  • 7. What are the two keyboard keys you can press at the same time to use the Paste command? (1.0 points) Lesson 5 (5.0 points)
    13·1 answer
  • What does network administration normally include? Check all of the boxes that apply.
    8·1 answer
  • DRU is a small brokerage house that enables its clients to buy and sell
    12·1 answer
  • Write a C++ program that consist
    5·1 answer
  • Question 2 (6 points)
    11·1 answer
  • RAM IS often referred
    9·1 answer
  • help i was building my pc and i pushed the cpu into the socket really hard until there was an audible crack and it went into the
    7·1 answer
  • What open source format has multiple versions for storing audio and video content?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!