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
How does information promote cooperation and Industry please explain​
IRISSAK [1]

Answer:

Provide teams with the resources they need to work together.

Train employees and encourage ongoing learning.

Encourage people to socialize outside of work.

Clarifying roles and setting expectations.

Review individual's talents.

Explanation:

6 0
2 years ago
In a car crash, wearing a seat belt __________________.
Bad White [126]

In a car crash, wearing a seat belt

A. Keeps you from being thrown from the car

B. can reduce injuries

The answer is : C. all of the above

<h3>Further explanation </h3>

In Newton's law, it is stated that if the resultant force acts on an object of magnitude is zero, it can be formulated:

<h3>∑F = 0 </h3>

This value is for stationary objects or objects that move in a straight line

So if the resultant force on an object is zero, the object that was initially stationary will continue to remain stationary, and the object that was initially moving will continue to move at a constant speed

The size of inertia is proportional to mass, the greater the mass of the object, the greater the inertia of the object.

In objects with mass that move translatively, the object will maintain its linear velocity

When we are in a vehicle that moves forward, then we will still maintain a state of forwarding motion. If our vehicle stops suddenly, then we keep moving forward so we will be pushed forward. From this point, the use of a safety belt serves to hold back our movements so that there are no fatal injuries or collisions.

<h3>Learn more </h3>

Newton's law of inertia

brainly.com/question/1412777

example of Newton's First Law of inertia

brainly.com/question/1090504

law of motion

brainly.com/question/75210

Keywords: inertia, Newton's First Law, collisions, injuries, car accident, crash

7 0
2 years ago
Read 2 more answers
Java Programming Using nested if statement For a student to be accepted in XYZ College, the student must meet the following requ
mihalych1998 [28]

Answer:

Follows are the solution to this question:

import java.util.*;//import package  

public class Main//defining a class

{

       public static void main(String[] ags)//main method  

       {

       float GPA;//defining floating point variable  

       int annual_income;//defining integer variable

       Scanner ga = new Scanner(System.in);//creating Scanner class object

       System.out.println("Enter GPA of student family : ");//print message

       GPA= ga.nextFloat();//input value from user-end

       System.out.println("Enter annual income of student family : ");//print message

       annual_income= ga.nextInt();//input value from user-end

      System.out.println("Is student resident of New Jersey(y/n) :");//print message

       char a=ga.next().charAt(0);//defining char variable to input char value

if(GPA>=3.75) //use if block to check GPA value

       {

        if(annual_income>60000) // use if to check annual income value

         {

            if((a == 'y'|| a== 'Y')) //use if to check char value

   System.out.println("Student accepted in college");//print message

            else//defining else block

             System.out.println("Student is not accepted in college because he/she not resident of New Jersey ");//print message

         }

        else//defining else block

          System.out.println("Student is not accepted in college because annual income is less than $60000 ");//print message

    }

   else//defining else block

    System.out.println("Student is not accepted in college because GPA is less than 3.75 ");//print message

       }

}

Output:

Please find the attached file.

Explanation:

Please find the attached file of the pseudocode.

In this code one integer, one float, and char variable "GPA, annual_income, and a" is declared, that uses the scanner class for accept value from the user-end, and in the next step, nested if the statement is used that checks the GPA value, annual_income, and a value and use the print method to print a value with the message.

6 0
2 years ago
Many large IT departments use a(n) _____ team that reviews and tests all applications and systems changes to verify specificatio
mafiozo [28]

Answer:

Quality assurance team

Explanation:

Software development life cycle (SDLC) is a process or stages of processes a software application must go through to be materialized. The stages of SDLC are planning, design, implementation or development, testing or verification, deployment and maintenance.

An implemented software design must be tested. It is tested based on the pre-dertermined design and the quality standard of the company. A group of test expect are approached for this purpose, they are called the quality assurance team

They are equipped with skills to use third party applications to analyze and verify the quality of the developed software.

6 0
2 years ago
You want to find information about Paris, France in the last five years, written in English. What is the best way to search for
KonstantinChe [14]
I say It could be B
8 0
3 years ago
Read 2 more answers
Other questions:
  • A communications system connecting two or more computers is called a(n) ________.
    7·1 answer
  • Select five system utility functions.
    11·1 answer
  • What is a mortgage?
    8·2 answers
  • Describe how mendeleev organized the elements into rows and columns in his periodic table.
    12·1 answer
  • A user complains that his new mouse doesn't work right. He has an old system at home and when he has had this problem, he cleane
    11·2 answers
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 then the outp
    12·1 answer
  • Tom's Art Supplies used to sell art supplies through mail order catalogs, but the company's order takers often had difficulty de
    9·1 answer
  • What icon is usually used to indicate an attachment feature?
    14·2 answers
  • The national highway system improved economic activity in Georgia by
    6·2 answers
  • Merging refers to dividing a single cell into multiple cells. *TrueFalse
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!