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]
1 year 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]1 year 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
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
Naya [18.7K]

Answer:

The program to this question as follows:

Program:

#include<iostream> //include header file.

using namespace std; //using name space.

int main() //main function.

{

int n,i,key; //define variable.

int a[n]; //define array

cout<<"Enter size of array :"; //message.

cin>>n; //input number from user.

cout<<"Enter array elements :"; //message

for(i = 0;i<n;i++) //loop

{

cin>>a[i]; //input array elements

}

cout<<"Enter a number:"; //message

cin>>key; //input number.

for(i = 0;i<n;i++) //loop

{

if(a[i]<=key) //if block

{

cout<<a[i]<<"\n "; //print array elements

}

}

return 0;

}

Output:

Enter size of array :7

Enter array elements :5

50

50

75

100

200

140

Enter a number:100

5

50

50

75

100

Explanation:

The description of the above program as follows:

  • In this program first, we include a header file and define the main method in method we define variables and array that are "n, i, key and a[]". In this function, all variable data type is "integer".
  • The variable n is used for the size of array and variable i use in the loop and the key variable is used for comparing array elements. Then we use an array that is "a[]" in the array, we use the for loop to insert elements form user input.  
  • Then we define a loop that uses a conditional statement in if block we check that array elements is less than and equal to a key variable. If this value is true so, we will print the remaining elements.  

4 0
1 year ago
Amanda a recently moved into a new home. Everyone has their own tablet, and wants to connect to the same network, no matter wher
vagabundo [1.1K]

Answer:

wifi is the best network for all, As it gets in all corners of the house.

7 0
2 years ago
Each of these is a basic type of a touch screen, except ________.
Oksanka [162]
<span>A touch screen gives response and acts simply with a touch on the screen area. Reflective screen is not a basic type of touch screen. The reflection can be reduced for the touch screen when it is combined with the LCD and the screen still be very visible. These screens can be anti glare and safe to the eyes.</span>
8 0
2 years ago
Read 2 more answers
Kayle is building a web form. He has included space where users can input their phone numbers and email addresses. However, he w
Digiron [165]

Answer:

D. javascript

Explanation:

use form validation method bro

8 0
1 year ago
Drag each label to the correct location on the image.
pantera1 [17]

Answer:

1.computer-based  training modules  is an example of hierarchical technique.

Explanation:

Computer based training modules are the example of hierarchical model or technique of website. In this technique courses or modules are linked with each other in hierarchical structure. To start some advance module we should learn some basic modules first.

2.school website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

3.bookstore  website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

4.single-product  websites is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

5.county library  website is an example of Webbed technique.

Explanation:

Computer based training modules are the example of webbed model or technique of website. In this technique many pages are connected or linked to many other pages and each page can access any other page. This is a complex structure of website.

6.online gift store  website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

7.federal government  website is an example of Webbed technique.

Explanation:

Computer based training modules are the example of webbed model or technique of website. In this technique many pages are connected or linked to many other pages and each page can access any other page. This is a complex structure of website.

3 0
2 years ago
Other questions:
  • What is one effective way for employees to keep their skillsets current?
    8·2 answers
  • What is a ribbon in word
    15·2 answers
  • Brianna would like to use a small program within the database to simplify the complicated task of creating a report. She should
    13·1 answer
  • When you reboot your system, the computer follows start-up instructions stored in this type of memory. multiple choice dram sdra
    15·2 answers
  • When Jen is planning to upgrade to a monitor with a better resolution, what should she be looking for in the new monitor? machin
    11·1 answer
  • Ld' is the instruction with the longest latency on the CPU from Section 4.4 (in RISC-V text). If we modified ld and sd so that t
    15·1 answer
  • Using Amdahl’s Law, calculate the speedup gain of an application that has a 60 percent parallel component for (a) two processing
    11·1 answer
  • Read the four detective reports and the combined affidavit and warrant for the M57 Patents case. Write a one- to two-page paper
    5·1 answer
  • Assume that machines A and B are on the same network 10.3.2.0/24. Machine A sends out spoofed packets, and Machine B tries to sn
    14·1 answer
  • In the graph shown here, by what percentage are the number of people in computer occupations in general projected to increase?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!