Ask Question

var testScores = []; testScores[0] = [80, 82, 90, 87, 85]; testScores[1] = [79, 80, 74, 82, 81]; testScores[2] = [93, 95, 89, 100, 85]; testScores[3] = [60, 72, 65, 71, 79]; (Refer to code example 16-1) Which of the following returns a value of 89? a. testScores[3][1]b. testScores[0][4]c. testScores[2][2]d. testScores[1][3]

+3
Answers (1)
  1. 7 November, 20:41
    0
    C) testScores[2][2]

    Explanation:

    Consider that the above has been translated into a java program. A two dimentional array is declared to hold the value of the testScores.

    The complete program and the output is given below

    public class twoDimenTestScores {

    public static void main (String[] args) {

    int[][] testScores = {

    {80, 82, 90, 87, 85},

    {79, 80, 74, 82, 81},

    {93, 95, 89, 100, 85},

    {60, 72, 65, 71, 79}

    };

    System. out. println (testScores[3][1]); / / prints 72

    System. out. println (testScores[0][4]); / / prints 85

    System. out. println (testScores[2][2]); / / prints 89

    System. out. println (testScores[1][3]); / / prints 82

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “var testScores = []; testScores[0] = [80, 82, 90, 87, 85]; testScores[1] = [79, 80, 74, 82, 81]; testScores[2] = [93, 95, 89, 100, 85]; ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers