12.2k views
1 vote
Write an application that stores at least five different college courses (such as CIS101), the time it first meets in the week (such as Mon 9 am), and the instructor (such as Johnson) in a two-dimensional array.

User Mariz
by
4.2k points

1 Answer

0 votes

Answer:

The solution code is written in Java

String unit [] [] = {

{"CIS101", "Mon 9 am","Johnson"},

{"CIS102", "Mon 11 am","Mike"},

{"CIS103", "Tues 9 am","Sherry"},

{"CIS104", "Tues 12 pm","Jeff"},

{"CIS105", "Tues 3 pm","Larry"},

};

Step-by-step explanation:

To create a two-dimensional array, we can declare a variable named it as unit and followed with two square brackets [ ]. The 2D array shall have five rows of record that entail each subject code, time first meet and instructor.

To get the first subject code, we can use the syntax as follow

unit [0] [0]

To get the instructor name for the second subject, we can write

unit[1] [2]