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
Which of the following is a set of short-range wireless technologies used to share information among devices within about two in
8_murik_8 [283]

Answer:

Option (c) NFC

Explanation:

  • The NFC Technology is a Wireless Technology which works in the range of 10 cm or less.
  • NFC stands for Near Field Communications.
  • The name itself indicates that it a communication mode with the near by objects.
  • The NFC technology is used in Access Cards, Payment Cards and Mobile Devices etc.
  • Option (a) IM - Instant Messaging is the instant text messaging technology sends and receives messages over the internet. It is used in Social Media where instant messaging is available. So, option (a) is not correct option.
  • Option (b) text messaging the technology is the technology in which the text messages are sent over the mobile networks ( in case of text messaging in mobile phones ) or over the internet ( emails, blogging etc). So, option (b) is not correct option.
  • Option (d) DES is not a short range wireless technology. So, option (d) is not correct.
  • Option (c) NFC is correct option.
3 0
2 years ago
A function is a built-in formula in a spreadsheet. <br> a. True<br> b. False
Anna11 [10]
YES its TRUE the answer is A. true. Spreadsheet is like excel that contains built in formula and ready to use. You just have to explore more on its environment and research more about the spreadsheet so that your work will easily be done
5 0
3 years ago
Read 2 more answers
Describe the function<br>ms word, Acess, Elexel, Power point<br>Publisher and Outlook​
marta [7]

Answer:

Write documents consisting mainly of text, Create databases, Create tables for organizing and calculating data, Create presentations to display in front of groups to display data and other info, Create advanced documents such as magazines, flyers, coupons, and other things, Organize your day and easily manage contacts and emails.

6 0
3 years ago
We study computer ___________ to become familiar with how circuits and signals collaborate to create working computer systems.
Arisa [49]

Answer:

organization

Explanation:

We study computer organization to become familiar with how circuits and signals collaborate to create working computer systems.

6 0
2 years ago
Thanks to ____ files, a website can recognize you and cater to your individual tastes each time you visit.
Licemer1 [7]
Saved files now and days
4 0
3 years ago
Other questions:
  • In three to five sentences, describe how technology helps business professionals to be more efficient. Include examples of hardw
    10·1 answer
  • I WILL MARK THE BRAINIEST!!!!!!!!!!!!! 50 POINTS!!!!!!!
    5·2 answers
  • Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorith
    8·1 answer
  • Emotional intelligence is a new term to describe personal traits ?
    12·1 answer
  • "A user reports that the corporate web server cannot be accessed. A technician verifies that the web server can be accessed by i
    8·1 answer
  • Which option for creating a table involves the use of a grid of squares?
    10·2 answers
  • Which term is used in object-oriented programming to reference characteristics of an object?
    15·1 answer
  • An important goal of biosecurity training is to: Prevent laboratory accidents that could expose personnel to hazardous agents. P
    13·1 answer
  • Tennis players are not allowed to swear when they are playing in Wimbledon
    6·2 answers
  • What game is this?????????????????????
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!