answer.
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]
2 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]2 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
Int side1;
o-na [289]

Answer:

int width_A, width_B, len_A, len_B;

float rw, rl;

rw = (float)(width_A/width_B);

rl = (float)(len_A/len_B);

if(rw == rl)

printf("They are similar");

else

printf("They are not similar");

Explanation:

The width of the first triangle i call width_A.

The width of the second triangle i call width_B.

The length of the first triangle i call len_A.

The length of the second triangle i call len_B.

The ratio of the width i call rw.

The ratio of the length i call rl.

If rw=rl, the retangles are similar. Otherwise, they are not.

The code is:

int width_A, width_B, len_A, len_B;

float rw, rl;

rw = (float)(width_A/width_B);

rl = (float)(len_A/len_B);

if(rw == rl)

printf("They are similar");

else

printf("They are not similar");

8 0
2 years ago
A network administrator is setting up a web server for a small advertising office and is concerned with data availability. The a
Aleksandr-060686 [28]

Answer:

RAID 1

Explanation:

RAID (Redundant Array of Inexpensive Disks or Drives, or Redundant Array of Independent Disks) is a data storage virtualisation technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both.

RAID 1

Disk mirroring, also known as RAID 1, is the replication of data to two or more disks. Disk mirroring is a good choice for applications that require high performance and high availability, such as transnational applications, email and operating systems. Disk mirroring also works with solid state drives so “drive monitoring” may be a better term for contemporary storage systems.

8 0
2 years ago
Suppose that you created an robot that was so advanced it could act independently in very complex situations. It made its own de
Mashutka [201]
It should not be capable of free action because there's no telling if it would be friendly for good remarks or mean for rude remarks
8 0
2 years ago
Given x and y, each associated with an int, write a fragment of code that associates the larger of these with another variable n
solmaris [256]

Answer:

The program to this question as follows:

Program:

x=int(input('Input the first number: ')) #defining variable x and input value by user

y=int(input('Input the second number: ')) #defining variable y and input value by user

if x > y: #if block to check value x>y

   max=x #define variable max that hold variable x value

   print('max number is: ', x) #print value

else: #else block

   max=y  #define variable max that holds variable y value

   print('max number is: ', y) #print value

Output:

Input the first number: 22

Input the second number: 33

max number is:  33

Explanation:

In the above code two-variable, "x and y" is defined, which holds a value, which is input by the variable. In the next step, the if block statement is used that can be described as follows:

  • In the if block, it will check x is greater than y it will define a variable, that is "max", that holds variable x value and prints its value.
  • In the else block, if the above condition is false it uses the max variable, that holds variable y value and prints its value.
8 0
2 years ago
Read a sentence from the console.
d1i1m1o1n [39]

Answer:

Answered below

Explanation:

#Program is written in Python programming language

sentence = input ("Enter sentence: ")

list_of_words = sentence.split()

for i in list_of_words:

#check if it is a digit

if not i.isdigit( ):

print ( i, sep= "\n" )

else:

#convert string to digits and double it

number = float( i )

double = number + number

print(double, sep="\n")

8 0
2 years ago
Other questions:
  • A cell reference that has only one $ is referred to as a(n) ____ cell reference. alternative mixed relative absolute
    7·1 answer
  • Secure Wi-Fi networks and VPNs use _____ to secure data transferred over a network.
    13·1 answer
  • Software code is tested, debugged, fixed, verified, and then:
    11·1 answer
  • Which data type change will require the app builder to perform the additional steps in order to retain existing functionalities?
    14·1 answer
  • Which broad area of data mining applications analyzes data, forming rules to distinguish between defined classes?
    13·1 answer
  • Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, con
    15·1 answer
  • [20 points] 3.3 Code Practice: Question 2
    7·1 answer
  • George is working with an image in Photoshop. He added a lot of effects to the image. He saved the first draft of the file. The
    6·2 answers
  • OH GOD PLEASE HELP I CAN'T FIGURE THIS OUT-
    6·1 answer
  • Even though Wordpress is basically free, what is the company trying to accomplish?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!