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
if person is male their username is the last 3 letters of their surname and the first 2 letters of their first name if a person
Svetradugi [14.3K]

gender = input("What's your gender? (`male` or `female`): ")

firstname = input("What's your firstname?: ")

surname = input("What's your surname?: ")

username = ""

if gender == "male":

   username += surname[-3:]

   username += firstname[0:2]

elif gender == "female":

   username += firstname[0:3]

   username += surname[-2:]

print(f'Your username is {username}')

3 0
3 years ago
If the density of water is 1 g/cm3, what is its specific gravity?
SpyIntel [72]

the answer should be D.

4 0
4 years ago
Read 2 more answers
Which option in the file menu will open a blank document?
artcher [175]

The answer is click on new

5 0
4 years ago
The operating system is loaded into memory during the ____ process
Svet_ta [14]
Installation process

8 0
3 years ago
What does system.out.printIn( )do in Java?
Katena32 [7]
You could get the Java for dummies book.

4 0
3 years ago
Other questions:
  • Tag groups can be nested up to ____ levels deep, with up to _______ tag subgroups under a single parent.
    14·1 answer
  • What happens to an LR if they troll/spam?
    13·1 answer
  • What are the conditions for using still photos in a video program
    6·1 answer
  • Write a program in pascal to find the area of a circle
    14·1 answer
  • An IT environment with a bastion host, an intrusion prevention system, and workstation antivirus and firewall software is an exa
    14·2 answers
  • Which statement below is incorrect when discussing communication in the online community?
    15·1 answer
  • Please I need all the help I can get
    11·1 answer
  • 2. Why don't all buses on a motherboard operate at the same speed?​
    6·1 answer
  • How do you respond to an email?
    6·1 answer
  • Guys help me, to get 25 examples of computer software​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!