Need to know what type of two dimensional array is in this code? I have put it in bold below. Code works but do not know what kind of two dimensional array it is as I want to learn it package IceCream

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Need to know what type of two dimensional array is in this code? I have put it in bold below. Code works but do not know what kind of two dimensional array it is as I want to learn it

package IceCream;

public class Bonus {
    
    private int[][] matrix; 

    public int getBonus(int weeks, int reviews) throws Exception {
           //if else statement
        if (weeks < 0 || reviews < 0)
            throw new Exception("Weeks and reviews cannot be less than zero");
        else if (weeks <= 6 && reviews <= 4)    //if they are both equal to or less than 6 weeks or 4 reviews
            return matrix[weeks][reviews];    
        else if  (reviews < 4)                    //if reviews are less than 4 and weeks more than 6
            return matrix[6][reviews];
        else if (weeks < 6)                        //if weeks is less than 6 and reviews more than 4
            return matrix[weeks][4];
       else
            return matrix[6][4];                //takes care of out of bounds exception when both are more than 6/4
    } 
    //7 rows(0 to 6) and 5 columns(0 to 4) 35 elements total in array
    //two dimensional array done as a matrix to simplify input
    public Bonus() {
        matrix = new int[7][5];
        matrix[0] = new int[] {25, 45, 80, 110, 150};
        matrix[1] = new int[] {50, 60, 90, 120, 180};
        matrix[2] = new int[] {100, 125, 160, 210, 265};
        matrix[3] = new int[] {160, 190, 225, 275, 340};
        matrix[4] = new int[] {230, 265, 325, 385, 450};
        matrix[5] = new int[] {300, 360, 420, 480, 600};
        matrix[6] = new int[] {425, 500, 600, 725, 875};
    }
       } 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education