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
garik1379 [7]
3 years ago
15

Write an application that allows a user to enter any number of student quiz scores until the user enters 99. If the score entere

d is less than 0 or more than 10, display an appropriate message and do not use the score. After all the scores have been entered, display the number of scores entered, the highest score, the lowest score, and the arithmetic average. Save the file as QuizScoreStatistics.java.
Computers and Technology
1 answer:
maria [59]3 years ago
3 0

Answer:

import java.util.Scanner;

import java.util.*;

import java.util.Collections;

class Main

{

public static void main(String[] args)  

{

     List<Integer> Scores = new ArrayList<Integer>();

     Scanner sc1=new Scanner(System.in);

     int i =0;

     int a=0;

     do

     {

       System.out.println("Enter score");

       a =sc1.nextInt();

       if (a <= 0)

       {

           System.out.println("You entered wrong score");

           continue;

       }

       else if ( a < 10 && a >0)

       {

           System.out.println("You entered wrong score");

           continue;

           

       }

       else

       {

           Scores.add(a);

       }

       i++;

     }while(a!=99);

     int max= Collections.max(Scores);

     int min=Collections.min(Scores);

     int sum=0;

     float averg =0;

     for(i=0; i<=Scores.size()-1;i++)

     {

        sum += Scores.get(i);

     }

     averg= sum/Scores.size();

     System.out.println("Maximum score" +max);

      System.out.println("Minimum score"+min);

     System.out.println("Average:"+averg);

   

}

}

Explanation:

Remember we need to use Arraylist and not array, as we do not know how many scores we are going to have. And we use Collections for this, where we have functions for finding maximum and minimum for arraylist, however, for average, we need to calculate. However, one should know that Arraylist has better options available as compare to arrays.

You might be interested in
What is the main storage device where the computer stores data?
Fudgin [204]
D. RAM
<span>Primary storage typically refers to random access memory (RAM), while secondary storage refers to the computer's internal hard drive. RAM, commonly called "memory," is considered primary storage, since it stores data that is directly accessible by the computer's CPU.</span>
8 0
3 years ago
3. Program to find the sum of all even numbers from m to n, where m and n
Gnom [1K]

Answer: M and E

Explanation: Hope this helps

8 0
3 years ago
What is the role of a control in a system that is functioning correctly
iren2701 [21]
A control system manages, commands, directs, or regulates the behavior of other devices or systems using control loops. It can range from a single home heating controller using a thermostat controlling a domestic boiler to large industrial control systems which are used for controlling processes or machines.
4 0
3 years ago
Using the Vigenere cipher, does the length of the key matter?
Dafna1 [17]
Yes, the longer the Key the harder the encryption i believe
6 0
4 years ago
"When analyzing the IDS logs, the system administrator notices connections from outside of the LAN have been sending packets whe
lakkis [162]

This is false negative. To be marked for alert.

<u>Explanation:</u>

The network administrator or network engineer when he or she is analyzing IDS logs and founded the ip address is same on source and destination both in outside side.

So the either TCPIP address has to change to be scanned across the network. Since same IP address is same pinging rate will high and pinging the same workstation or desktop or laptop.

Alert will not generate because both tcpip address same and if pinging is success.  Ids logs generates based true negative, true positive and false positive will not generate any alert.

5 0
4 years ago
Other questions:
  • What does usb stand for
    8·2 answers
  • A flowchart that depicts the relationships among the input, processing, and output of an AIS is
    6·1 answer
  • Many inventions have enabled us to use digital cameras. The biggest difference between traditional and digital cameras is that d
    10·1 answer
  • The __________ utility has the capability to manage users, create and administer user groups, and apply user rights to those use
    8·1 answer
  • 6-1) (Math: pentagonal numbers) A pentagonal number is defined as n(3n–1)/2 for n = 1, 2, . . ., and so on. Therefore, the first
    10·1 answer
  • C++ please
    8·1 answer
  • What is another name for repetition in programming?
    11·1 answer
  • Malware is any malicious software installed on a computer or network without the owner’s knowledge.
    10·1 answer
  • What is the different between the patch Tool and the Headling Brush tool?​
    5·1 answer
  • Indonesia is planning to move its capital from Jakarta to the island of Borneo in the hope that the burden of congestion, regula
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!