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
shutvik [7]
3 years ago
10

Write a program that accepts any number of homework scores ranging in value from 0 through

Computers and Technology
1 answer:
Dimas [21]3 years ago
6 0

Answer:

This program is written in Java programming language.

It uses an array to store scores of each test.

And it also validates user input to allow only integers 0 to 10,

Because the program says the average should be calculated by excluding the highest and lowest scores, the average is calculated as follows;

Average = (Sum of all scores - highest - lowest)/(Total number of tests - 2).

The program is as follows (Take note of the comments; they serve as explanation)

import java.util.*;

public class CalcAvg

{

public static void main(String [] args)

{

 Scanner inputt = new Scanner(System.in);

 // Declare number of test as integer

 int numTest;

 numTest = 0;

 boolean  check;

  do

  {

   try

   {

     Scanner input = new Scanner(System.in);

    System.out.print("Enter number of test (1 - 10): ");

    numTest = input.nextInt();

    check = false;

    if(numTest>10 || numTest<0)

     check = true;

   }

   catch(Exception e)

    {

     check = true;

   }

  }

  while(check);

  int [] tests = new int[numTest];

//Accept Input

for(int i =0;i<numTest;i++)

{

System.out.print("Enter Test Score "+(i+1)+": ");

tests[i] = inputt.nextInt();

}

           //Determine highest

           int max = tests[0];

           for (int i = 1; i < numTest; i++)

           {

               if (tests[i] > max)

               {

                   max = tests[i];

               }

           }

           //Determine Lowest

           int least = tests[0];

           for (int i = 1; i < numTest; i++)

           {

               if (tests[i] < least)

               {

                   least = tests[i];

               }

           }

           int sum = 0;

           //Calculate total

           for(int i =0; i< numTest;i++)

           {

               sum += tests[i];

           }

           //Subtract highest and least values

           sum = sum - least - max;

           //Calculate average

           double average = sum / (numTest - 2);

           //Print Average

           System.out.println("Average = "+average);

           //Print Highest

           System.out.println("Highest = "+max);

           //Print Lowest

           System.out.print("Lowest = "+least);

}

}

//End of Program

You might be interested in
Cell division is called:
Blizzard [7]

Answer:

Mitosis

Explanation:

6 0
3 years ago
Blank includes websites that encourage interaction and connection among people businesses and organizations
liberstina [14]
C is your answer to this problem

4 0
3 years ago
Read 2 more answers
In what way are high-level programming languages limited? (5 points)
Nat2105 [25]

Answer: High-level computer languages must be translated into assembly or machine languages by a compiler before they can be executed, making them slightly slower to execute than raw assembly or machine language. The answer is D.

4 0
3 years ago
Read 2 more answers
Does anybody know how to do 6.3 code practice on edhesive. NEED ASAP!!!​
Lady_Fox [76]

Answer:

Hopes this helps if not comment and I'll change it

Explanation:

import simplegui

import random

def draw_handler(canvas):

for i in range (0, 1000):

x = random.randint(1, 600)

y = random.randint(1, 600)

r = random.randint(0, 255)

g = random.randint(0, 255)

b = random.randint(0, 255)

color = "RGB( " + str(r) + "," + str(g) + "," + str(b) + ")"

canvas.draw_point((x, y), color)

frame = simplegui.create_frame('Points', 600, 600)

frame.set_canvas_background("Black")

frame.set_draw_handler(draw_handler)

frame.start()

8 0
3 years ago
AYUDAAAA!!!!! URGENTE!!!!!!1<br> ¿para que sirve la "BIG DATA"?
Lisa [10]

Answer:

Big data is a field that treats ways to analyze, systematically extract information from, or otherwise deal with data sets that are too large or complex to be dealt with by traditional data-processing application software. ... Big data was originally associated with three key concepts: volume, variety, and velocity.

SPANISH TRANSLATION

Big data es un campo que trata formas de analizar, extraer sistemáticamente información de, o de otra manera tratar con conjuntos de datos que son demasiado grandes o complejos para ser manejados por el software tradicional de aplicación de procesamiento de datos. ... Big data se asoció originalmente con tres conceptos clave: volumen, variedad y velocidad.

7 0
3 years ago
Other questions:
  • A(n) _____ of an class is where the services or behaviors of the class is defined. (Points : 6) operation
    6·1 answer
  • A “greedy algorithm” sometimes works well for optimization problems???
    5·1 answer
  • Which is the largest unit of measurement for computer data?
    14·1 answer
  • The Leader Motive Profile (LMP) includes a: a. high need for power. b. low need for achievement. c. moderate need for power. d.
    6·1 answer
  • Look at the following code:
    7·1 answer
  • If you have a database of books in the library and you would like to find all books published after January 1, 2008, what criter
    7·1 answer
  • When is a handrail required for stairs
    12·2 answers
  • 2.11 (Separating the Digits in an Integer) Write a script that inputs a five-digit integer from the user. Separate the number in
    12·1 answer
  • The ___________ method returns the length of an array.
    11·2 answers
  • MCQ: Which of the following network is confined to a relatively small area?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!