import javax.swing.*;
class FindPoints
{
public static void main(String[] args)
{
int[][] points =
{{10, 20, 30},
{20, 40, 60},
{40, 60, 80}};
String prompt;
int class;
int level;
prompt = JOptionPane.showInputDialog(null, "Class: ");
class = Integer.parseInt(prompt);
prompt = JOptionPane.showInputDialog(null, "Level: ");
level = Integer.parseInt(prompt);
JOption.showMessageDialog(null, "Your points: " + points[class][level]);
}
}
The above code depicts a two-dimensional array named points that refers to a Class and Level to determine a point value. If a user inputs a Class of 1 and a Level of 2, what point value will be displayed when the program executes? Explain how you arrived at your answer.
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q63: What are some of the advantages of
Q64: Using the ArrayList add() method, write the
Q65: Write the statement to declare an ArrayList
Q66: int[][] studentScores = {{70, 82, 90, 68},
Q67: import javax.swing.*;
class FindPoints
{
public
Q69: import java.util.*;
public class myArray
{
public
Q70: How can you use the length field
Q71: int[][] myVals = {{10, 15, 20, 25},
Q72: What are some of the advantages of
Q73: Declare an ArrayList that declares a list
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents