1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ELEN [110]
4 years ago
5

Write an application that displays a series of at least five student ID numbers (that you have stored in an array) and asks the

user to enter a numeric test score for the student. Create a ScoreException class, and throw a ScoreException for the class if the user does not enter a valid score (less than or equal to 100). Catch the ScoreException, display the message Score over 100, and then store a 0 for the student’s score. At the end of the application, display all the student IDs and scores. g
Computers and Technology
1 answer:
babymother [125]4 years ago
8 0

Answer:

See explaination for the program code

Explanation:

// ScoreException.java

class ScoreException extends Exception

{

ScoreException(String msg)

{

super(msg);

}

}

// TestScore.java

import java.util.Scanner;

public class TestScore

{

public static void main(String args[]) throws ScoreException

{

Scanner sc = new Scanner(System.in);

int studentId[] = { 1201, 1202, 1203, 1204, 1205 };

int scores[] = new int[5];

int score = 0;

for(int i = 0; i < studentId.length; i++)

{

try

{

System.out.print("Enter a numeric test score for the student"+(i+1)+" of Id "+studentId[i]+" : ");

score = sc.nextInt();

if(score < 0 || score > 100)

{

scores[i] = 0;

throw new ScoreException("Input should be between 1 and 100");

}

else

{

scores[i] = score;

}

}

catch(ScoreException ex)

{

System.out.println("\n"+ex.getMessage()+"\n");

}

}

//displaying student details

System.out.println("\n\nStudent Id \t Score ");

System.out.println("=============================");

for(int i = 0; i < studentId.length; i++)

{

System.out.println(studentId[i]+"\t\t"+scores[i]);

}

}

}

You might be interested in
What is syntax?
Basile [38]

Answer:

a

(would really appreciate the brainliest)

5 0
3 years ago
Create a class RightTriangle which implements the API exactly as described in the following JavadocLinks to an external site..
WARRIOR [948]

Answer:

I don't see anything. Its blank

Explanation:

3 0
2 years ago
Refer to the exhibit. A network security analyst is using the Follow TCP Stream feature in Wireshark to rebuild the TCP transact
Mnenie [13.5K]

Answer:

Binary file.

Explanation:

                           In this case, the network security analyst is using the Follow TCP Stream feature in Wireshark to rebuild the TCP transaction. However, the transaction data seems indecipherable. The explanation for this is that the TCP transaction file is a Binary File and because of this the network secuirty analyst is unable to decipher the transaction file.

                           The solution for this is to convert the binary file into text file which is human readable.

3 0
3 years ago
Which of the following can a cell contain?
Ksju [112]
The answer is choice D-All of these :)
8 0
3 years ago
Read 2 more answers
43
pshichka [43]

Answer:

c

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • To use the Web, each client computer requires a data link layer software package called a Web browser. True False
    8·1 answer
  • Anybody good with Microsoft excel? I need help with this class.
    9·2 answers
  • In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism b
    7·1 answer
  • Can Anybody Answer This
    8·1 answer
  • Images using pixels are ____________________ images, while images using mathematics are ____________________ images
    13·1 answer
  • How can i change my age on my profile here bc i am 13 but i accidenlty put 2005 instead of 2006 no need to rush to answer just w
    9·2 answers
  • What are the possible consequences if requirements analysis was done poorly or inadequately? What are the objectives of requirem
    10·1 answer
  • What is the next line?
    14·1 answer
  • Match the roles to the task they perform.
    5·1 answer
  • A data mart is the operational database for the company. group of answer choices true false
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!