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
Ratling [72]
2 years ago
6

Write a public static method diagSum, which takes a 2d array of int values as a parameter, and returns the sum of the elements i

n the lead diagonal as an int value. The lead diagonal is defined as the diagonal line of values starting in the top left corner and proceeding one step right and down for each value until either the bottom or right edge of the array is reached. For example, in the array represented below, the numbers in red make up the lead diagonal
Computers and Technology
1 answer:
saveliy_v [14]2 years ago
6 0

A 2d array (i.e. 2 dimensional array) represents its elements in rows and columns

<h3>The program in Java</h3>

The method in Java, where comments are used to explain each line is as follows

//This defines the method

public static int diagSum(int[][] myArray) {

    //This initializes sum to 0

    int sum = 0;

    //This iterates through each row of the array

               for (int i = 0; i < myArray.length; i++) {

                   //This calculates the sum of the diagonals

                       sum+=myArray[i][i];

               }

               //This returns the sum

               return sum;

       }

Read more about methods at:

brainly.com/question/15969952

You might be interested in
Professor Zak allows students to drop the four lowest scores on the ten 100 point quizzes she gives during the semester. Design
lana66690 [7]

Answer:

Explanation:

Let's do this in Python, we will accept 2 arguments, the student name and an array of the 10 scores. The function would sort the scores out, get the last 6 scores, take the sum and finally out put them with the student name:

def total_six_highest_score(name, scores):

    scores.sort()

    highest_six_scores = scores[4:]

    total_highest = sum(highest_six_scores)

    return name, total_highest

4 0
3 years ago
Jason works as an accountant in a department store. He needs to keep a daily record of all the invoices issued by the store. Whi
kotykmax [81]

Are there any options

3 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly.
faltersainse [42]

The resource allocation section of the test plan contains the information regarding the features to be tested in the test plan.

<h3>What is resource allocation?</h3>

The distribution and disbursement of the total disposable resources within an organization towards the different functions and processes in an organization is referred to as resource allocation.

The main functionality of a resource allocation section in a test plan is to portray the features of the test that will be conducted by the team of experts.

Hence, the functions of resource allocation in a test plan are as aforementioned.

Learn more about resource allocation here:

brainly.com/question/17837067

#SPJ1

5 0
2 years ago
What is the output of the following code snippet? double income = 45000; double cutoff = 55000; double minIncome = 30000; if (mi
MissTica

Answer:

Income requirement is met.

Explanation:

(minIncome > income) will evaluate to false

(cutOff < income) will evaluate to false

the else portion will be executed which is "Income requirement is met"

7 0
4 years ago
A type of specialty processor devoted exclusively to protecting your privacy.
drek231 [11]
 Cryptoprocessor would be it.
8 0
3 years ago
Read 2 more answers
Other questions:
  • A software program that allows a programmer to type in code. modern versions usually make it easy to format the code on the scre
    13·1 answer
  • Binary is a sequence of 0s and 1s such as 1001101 which can be used to code information. To break a code, you need to find how m
    14·1 answer
  • An enterprise system is a packaged software application that helps integrate various ___________ in a company.
    15·2 answers
  • An anagram is a word or a phrase made by transposing the letters of another word or phrase; for example, "parliament" is an anag
    7·1 answer
  • list = 7 # these many modified Fibonacci numbers. def fibonacci_gt(n, t1, t2): if n&lt;0: print("Incorrect input") elif n == 0:
    12·1 answer
  • Controlling access of information on the internet
    15·1 answer
  • During a test, it is generally best to: A. answer all questions in order B answer the essay questions first C. answer the least
    7·2 answers
  • 3. Which property provided the labels in the list below?
    9·1 answer
  • What do you think will happen as more traditional jobs disappear due to technology? Will new jobs take their place?
    13·1 answer
  • Mention any
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!