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
The video game machines at your local arcade output coupons depending upon how well you play the game. You can redeem 10 coupons
Lilit [14]

Answer:

coupons = int(input("Enter the number of coupons you win: "))

candy_bars = int(coupons / 10)

gumballs = coupons % 10

print("Candy bars: " + str(candy_bars) + ", Gumballs: " + str(gumballs))

Explanation:

*The code is in Python.

Ask the user to enter the number of coupons

Calculate the number of candy bars, divide the coupons by 10 and typecst the result to int

Calculate the number of gumballs, use the modulo to find the remainder

Print the values

3 0
3 years ago
Jennifer, a customer, informs you that unexpected icons are appearing on her system's desktop. You identify the symptoms of the
Maslowich

Answer:

B. Schedule scans and run updates.

Explanation:

With a malware infection you have to scan the computer with an antivirus immediately. Then, you run possible updates to get the system stronger.

8 0
4 years ago
In older systems, often the user interface mainly consisted of ____-control screens that allowed a user to send commands to the
Scilla [17]

Answer:

Process

Explanation:

In older systems, the user interface mainly consisted of process-control screens that allowed a user to send commands to the system. These systems were used in a great variety of industries, and it gave the user control over process measurements or process variables. It also allowed the user to view the current state of the process, modify the operation of the process, and perform other related actions.

6 0
4 years ago
Which wildcard characters will return a single character when using the Find dialog box?
scoray [572]

Answer:

?

Explanation:

It is the "?" character. When we type in the ? in the regular expression, then it means that it will be replaced by a single character. And when we type *, then we mean there can be multiple, and any number of characters. And this is what is meant by these two wildcard characters. Hence, the correct option here is ?.

Example: ?op can be top, pop, etc, and we can see here that, ? is replaced by only one character each time.

7 0
3 years ago
Read 2 more answers
Which Internet security risk is associated with dumpster diving?
lora16 [44]

Which Internet security risk is associated with dumpster diving? Identity theft. Identity theft is associated with dumpster diving because it involves taking something from someone else. In this case, instead of looking through a dumpster to get items that were someone elses, they are taking their identity and using it for their own purposes. So identity theft and dumpster diving relate when used in this context.

3 0
4 years ago
Read 2 more answers
Other questions:
  • Which of the four basic functions of a computer refers to the collection of data by a computer?
    11·2 answers
  • Choose the false statement below. The content that displays in the browser is contained in the head section. The content that di
    14·1 answer
  • How can you print a mailing label in word
    13·1 answer
  • You've just purchased 10 new notebook systems for your users. You are concerned that users will leave the systems on for long pe
    10·1 answer
  • if you play creative destruction and if u have a mic and if u play it 24/7 and would like to form a team tell me your name or yo
    7·1 answer
  • A blog is Group of answer choices a character in Lineage,
    15·1 answer
  • Which scenario could be represented by the given graph?
    14·1 answer
  • What is the most significant issue that needs to be addressed when ensuring the proper functioning of a computer?
    7·1 answer
  • Differentiate between CD-ROMS and DVD-ROMS​
    8·1 answer
  • To uncompress the data back into its original binary state, you simply reverse the process. This technique is an example of what
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!