Skip to content
View in the app

A better way to browse. Learn more.

Dragonmount

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

for MATT

Featured Replies

// The "TwoDimensionalArrayTable" class.

//NAME: CLINTON SHEPLEY

//DATE: SEPTEMBER 18

//PROGRAM DESCRIPTION: Two dimensional array are tables with rows and columns

//from page 361 in the java book, adapt the program to use r for the

//first loop and c for the second loop change the nested loop for marks input

//Improve page 361 by adding a single dimension array for names.

 

 

//assign values to the array

import java.awt.*;

import hsa.Console;

 

public class TwoDimensionalArrayTable

{

static Console c; // The output console

 

public static void main (String[] args)

{

c = new Console ();

 

// Place your program here. 'c' is the output console

int rows;

int subj;

c.println ("HOw many people(rows) are in the class?");

rows = c.readInt ();

c.println ("How many subjects are there?");

subj = c.readInt ();

//Variables

String course[];

course = new String [subj]; //array for subjects

String names[];

names = new String [rows]; //array for rows

 

int table[] []; //declare the array

table = new int [rows] [subj]; //**instantiates the array to create a new object

 

for (int cc = 0 ; cc < (subj) ; cc++)

{

c.println ("Enter a subject");

course [cc] = c.readLine ();

 

}

for (int r = 0 ; r < (rows) ; r++)

{

c.println ("Enter a Name");

names [r] = c.readLine ();

 

}

//mainline

for (int r = 0 ; r < (rows) ; r++)

{

// table [r] [0] = r + 1;

c.println ("Enter a Mark for " + names [r]);

for (int cc = 0 ; cc < (subj) ; cc++)

{

c.print ("Enter mark for subject " + course [cc]);

table [r] [cc] = c.readInt (); //initializes and assigns values to the array

}

}

//print table

c.print ("NAME", 7);

for (int cc = 0 ; cc < (subj) ; cc++)

{

c.print (course [cc], 7);

 

 

}

 

c.println ();

 

 

 

for (int r = 0 ; r < (rows) ; r++)

{

c.print (names [r]);

for (int cc = 0 ; cc < (subj) ; cc++)

{

c.print (table [r] [cc], 7);

 

 

}

c.println ();

}

} // main method

} // TwoDimensionalArrayTable class

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.