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]
3 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]3 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
Modern ssds use a technique called "____" to spread write operations around the storage medium, thus evening out the impact of d
masha68 [24]

The question above has multiple choices as below;

<span>a.      </span>Wear aggregation.

<span>b.      </span>Wear mitigation.

<span>c.      </span>Wear prevention

<span>d.      </span>Wear leveling

The answer is d) Wear leveling.


This technique by some SSD controllers to increase the memory’s lifetime is called wear leveling. The mechanism for this principle is simple: distribute the entries for all the blocks evenly so that they will wear out evenly. Flash controller typically manages wear leveling and uses a wear leveling algorithm to control which physical block to use.







7 0
2 years ago
Who conceptualizes the design and the working of a website
Citrus2011 [14]
Answer is "Web Designer".

Web Designers are the "artists" of the website. They conceptualize the layout and functionality of the site, from features to format. They may do little coding, and are mostly involved in the creative elements of web design. The Web Developer is less big-picture, and more knitty-gritty building of the website. She is the one who does the coding and actually builds the website, using the web designer's model. 
3 0
3 years ago
Any executable files???
Kipish [7]

Doesn't look like there are any..

7 0
2 years ago
Which of the following is the java comparison operator for "not equal to"
Sveta_85 [38]
You need to provide "the following", otherwise other users cannot answer your question.

However, the Java operator for "not equal to" is "!=".


// For example.
if (1 != 2) {
    System.out.println("1 doesn't equal 2");
}


The if-statement in the code above will always run, since 1 is not equal to 2.
8 0
3 years ago
How frequently should computers containing ehr information be backed up?
geniusboy [140]
Explain what is meant by a limited data set and how this HIPAA rule may affect medical assistants
7 0
3 years ago
Other questions:
  • Which occupation requires certification by the state?
    15·2 answers
  • According to a recent study, more than 75 percent of teens between the ages of twelve and seventeen in the United States have a
    11·2 answers
  • What are the data types used in C programming with examples
    5·1 answer
  • The computer has had far-reaching effects on our lives.how has the computer effected your life?
    8·1 answer
  • Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and
    5·1 answer
  • Consider a multidimensional array A stored in row-major order with 22 rows and 6 columns whose subscripts start at 0. If each el
    8·1 answer
  • 7. A patent is an example of a rare and valuable resource. Indicate whether the statement is true or false and also justify it.
    14·1 answer
  • In Tynker, it is not possible to create a/an __________.
    6·2 answers
  • What is the minimum number of bits you would need to represent a number on a 0 to 10 scale
    15·1 answer
  • search engines use software that combs the web to find webpages and add new data about them to the database. what is this softwa
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!