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
lesya692 [45]
3 years ago
9

Write a program called GradesAverage, which prompts user for the number of students, reads it from the keyboard, and saves it in

an int variable called numStudents. It then prompts user for the grades of each of the students and saves them in an int array called grades.
Your program must:
1. Make sure you store the grades entered in an array.
2. Compute the average in a separate method from the main().
3. Check the numStudents is a number, otherwise continue to prompt until they do.
4. Check the grade is between 0 and 100, otherwise continue to prompt until they do.
5. Have the user's entry from the console stay on the same line. (see example below)
Computers and Technology
1 answer:
marishachu [46]3 years ago
4 0

Answer:

See Explaination

Explanation:

import java.io.BufferedReader;

import java.io.InputStreamReader;

public class GradesAverage {

private static int checkNum(String num) {

int tmpNum;

try {

tmpNum = Integer.valueOf(num);

} catch(IllegalArgumentException e) {

System.out.println("You did not enter an integer.");

return -1;

}

return tmpNum;

}

private static boolean validNum(int num) {

if(num>=0 && num<=100) {

return true;

}

System.out.println("You did not enter an integer, try again

You might be interested in
Your wireless network has been breached and it seems as though the attacker has modified a portion of your data that is used wit
Vlad1618 [11]

Answer: IV attack

Explanation:

 IV attack is stand for the initialization vector attack that are used over the wireless network an it is used as the encrypted packet during the process of transmission. An initialization vector attack basically attempts for exploits for exposing the encrypted information.

 According to the question, the IV attack is basically used with the stream cipher for exposing the information wirelessly.

The initialization vector is one of the arbitrary number that are used in the for  of secret key in the system and it helps in prevent the duplicate character in ciperhtext.

 Therefore, IV attack is the correct answer.

8 0
3 years ago
How does consumption of alcohol affect your driving skills? Name three ways that alcohol can affect your driving.
Natali [406]

Drinking and driving is not recommended. You need your, hands, feet, brain, and eyes to maneuver around. Drivers must be alert and able to make judgments quickly. Drinking and driving can affect the driver in the following ways.

Judgment

The brain is the first part of the body that is affected by alcohol. Your ability to think clearly and plan ahead levels down to as low as .02%

Concentration

Alcohol can leave you concentrating on only one action. You need to stay focused on several things at once. Alcohol will interrupt your focus and might result to an accident. Many accidents are as a result of a short attention span or a distracted driver.

Vision

Alcohol, especially when taken in excess, will impair your eye movement. Not only will it slow down your eye muscle function but  will also reduce peripheral vision.

8 0
4 years ago
Read 2 more answers
Write a class called Line that represents a line segment between two Points. Your Line objects should have the following methods
mel-nik [20]

Answer:

import java.awt.Point;

public class Line{

private Point point1, point2;

public Line(Point p1, Point p2){

point1 = p1;

point2 = p2;

}

public Point getP1(){

return point1;

}

public Point getP2(){

return point2;

}

public String toString(){

return "[( The " + point1.x + "," + point1.y + "), (" + point2.x + "," + point2.y +")]";

}

public static void main(String args[]){

Line lineObj = new Line(new Point(7,9), new Point(6,2));

System.out.println(lineObj.toString());

}

}

Explanation:

  • Declare the points inside the class Line.
  • Initialize the getters and setters method for the class.
  • Define a toString method that returns the information in a formatted manner.
  • Inside the main method, initialize an object with some values.
  • Display the information by calling the toString method.
4 0
3 years ago
What are the methods used in research methodology?
earnstyle [38]
Experiments. ...
Surveys. ...
Questionnaires. ...
Interviews. ...
Case studies. ...
Participant and non-participant observation. ...
Observational trials. ...
Studies using the Delphi method.
5 0
3 years ago
Directions: pick the right letter for each number.
Ede4ka [16]

1. Upgrading RAM increases run speed.

2. Upgrading Hard Drive increases memory.

3. Adding more ROM to it..?

8 0
4 years ago
Read 2 more answers
Other questions:
  • The arithmetic logic unit (alu) controls all of the functions performed by the computer's other components and processes all the
    7·1 answer
  • python If the checksum is 10, the last digit is denoted as X according to the ISBN-10 convention. Write a program that prompts t
    10·1 answer
  • How to make your keyboard sound like a piano?
    9·1 answer
  • Question 4 of 20
    5·1 answer
  • Which are examples of non-linear presentations? Choose all that apply.
    11·1 answer
  • What do you need for digital photography? 1. 2. 3.
    13·1 answer
  • Which of these is an example of rebranding ?
    6·2 answers
  • A local cinema allows customer to make a movie ticket reservation. A customer can be
    6·1 answer
  • Miley met up with a bunch of her college friends after several years. She told them that she works for the sound department of a
    5·1 answer
  • One way to check if a website is secure is to look for a/an<br> in the address bar.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!