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
pshichka [43]
3 years ago
5

Write a Java program that will be able to generate the sample table below.

Computers and Technology
1 answer:
Gwar [14]3 years ago
7 0

Answer:

class Main {

 public static void fillTable(int [][] t, int or, int oc) {        

   for(int r=0; r<t.length; r++) {

     for(int c=0; c<t[r].length; c++) {

         t[r][c] = Math.max(1+Math.abs(r-or), 1+Math.abs(c-oc));

       }

   }

 }

 public static void dumpTable(int [][] t) {

   for(int r=0; r<t.length; r++) {

     for(int c=0; c<t[r].length; c++) {

       System.out.printf("%3d", t[r][c]);

     }

     System.out.println();

   }

 }

 public static void main(String[] args) {

   int origin_row = 3;

   int origin_col = 2;

   

   int[][] table = new int[5][4]; // rows|cols

   fillTable(table, origin_row, origin_col);

   dumpTable(table);

   

 }

}

Explanation:

Above program does not contain input handling and exception handling, but it does contain the cleverness of calculating the cell values. I'm hoping you can add the input handling yourself?

You might be interested in
What subsection of the Internet requires specialized browser to access and is frequently used by cyber criminals and underground
kotykmax [81]

Answer:

c. Dark Web                                                

Explanation:

Surface web is also called visible web is a part of world wide web that can be easily searchable using search engines as its contents are indexed by the search engines such as Google and its contents are accessible by public using standard web browsers. So a is not a suitable choice.

Deep Web is called invisible web as it is not accessible or searchable to standard search engines like Google. Search engines cannot index the contents of these sites. However such sites do not requires specialized browsers to access. So b is not a suitable choice.

Dark Web: It is a part of Deep Web sites but it requires specialized software and browsers to access. These sites cannot be indexed and cannot be searchable through standard search engines. This is also called dark side of the world wide web darker which is frequently used by criminals, hackers, black markets, hit-men. Illegal activities on a massive level is takes place in the dark web such as access to stolen sensitive information, malware, drug trade and terrorist operations. These sites are temporary and keep changing addresses to lessen the risk of getting caught by govt agencies or security officials. So c is the suitable choice.

Crypto-Net is a kind of neural network which works with encrypted data which can make a prediction based on the data without disclosing the data and prediction to the 3rd party. So d is not a suitable option.

6 0
3 years ago
Helppppppppppppppppppppppppppppppppp
Natalija [7]

Answer:

answer below

Explanation:

hope this helps

6 0
2 years ago
Read 2 more answers
Explain about third generation of computer​
diamong [38]

Answer:

The period of third generation was from 1965-1971. The computers of third generation used Integrated Circuits (ICs) in place of transistors. ... This development made computers smaller in size, reliable, and efficient. In this generation remote processing, time-sharing, multiprogramming operating system were used.

Explanation:

hope it helps

6 0
3 years ago
Computers store all characters as numbers stored as binary data. Each instruction or symbol gets a bit string assignment. The st
juin [17]

Answer:

0 and 1

Explanation:

Please mark brainliest

7 0
3 years ago
What is data and instructions entered into the memory of a device
lyudmila [28]

A POINTING DEVICE IS AN INPUT DEVICE THAT ALLOWS A USER TO CONTROL A POINTER ON THE SCREEN. ... A KEYBOARD IS AN INPUT DEVICE THAT CONTAINS KEYS USER TO ENTER DATA AND INSTRUCTIONS INTO A COMPUTER.                                                                            

SORRY FOR CAPS MY CAPS KEY GOT STUCK

3 0
4 years ago
Other questions:
  • Given three dictionaries, associated with the variables, canadian_capitals, mexican_capitals, and us_capitals, that map province
    11·1 answer
  • The different concepts in the architecture operating model are aligned with how the business chooses to integrate and standardiz
    10·2 answers
  • What is the name of the malware included in CCleaner?
    11·1 answer
  • Two electronics technicians are measuring electrical quantities in circuits. Technician A says that copper, glass, porcelain, an
    13·2 answers
  • When you use the Filter feature, what appears in each column label
    11·1 answer
  • What command prompts should be used to assign an IP address to:
    9·1 answer
  • You are contacted by a project organizer for a university computer science fair. The project organizer asks you to hold a forum
    10·1 answer
  • Which of the following is a variable expense for many adults?
    11·2 answers
  • The engine flywheel bolts to the Rotor Pistons Front axle Crankshaft
    13·1 answer
  • When should you use an ELIF statement?<br> Edhesive
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!