Question
Java import javax.swing.*; class FindPoints { public static void main(String[] args) { int[][] points = {{10, 20, 30}, {20, 40, 60}, {40, 60, 80}}; String
Java
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.
.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started