Examlex

Solved

​Import Javax.swing.*; Class FindPoints

question 7

Essay

​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.


Definitions:

Median Household Income

The middle value of household incomes when arranged in ascending or descending order, dividing the income distribution into two equal halves.

Teen Pregnancy

Pregnancy occurring in young women or girls within the teenage years, often considered as ages 13-19.

Oropharyngeal Cancers

Cancers that occur in the oropharynx, the middle part of the throat behind the mouth, often associated with HPV infection.

Human Papillomavirus

A group of more than 200 related viruses, some of which are associated with various types of cancer, including cervical cancer.

Related Questions