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
Rasek [7]
2 years ago
13

write a java program that prompts the user to enter scores (each number an integer from 0 to 10) and prints the following output

: how many scores entered the highest score the lowest score the average of all the scores the average with the highest and lowest score not counted if the user enters less than 3 scores print an error message instead of the output above
Computers and Technology
1 answer:
Vladimir [108]2 years ago
4 0

Answer:

Explanation:

The following is written in Java. It continues asking the user for inputs until they enter a -1. Then it saves all the values into an array and calculates the number of values entered, the highest, and lowest, and prints all the variables to the screen. The code was tested and the output can be seen in the attached image below.

import java.util.ArrayList;

import java.util.Arrays;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int count = 0;

       int highest, lowest;

       ArrayList<Integer> myArr = new ArrayList<>();

       while (true) {

           System.out.println("Enter a number [0-10] or -1 to exit");

           int num = in.nextInt();

           if (num != -1) {

               if ((num >= 0) && (num <= 10)) {

                   count+= 1;

                   myArr.add(num);

               } else {

                   System.out.println("Wrong Value");

               }

           } else {

               break;

           }

       }

       if (myArr.size() > 3) {

           highest = myArr.get(0);

           lowest = myArr.get(0);

           for (int x: myArr) {

               if (x > highest) {

                   highest = x;

               }

               if (x < lowest) {

                   lowest = x;

               }

           }

           System.out.println("Number of Elements: " + count);

           System.out.println("Highest: " + highest);

           System.out.println("Lowest : " + lowest);

       } else {

           System.out.println("Number of Elements: " + count);

           System.out.println("No Highest or Lowest Elements");

       }

   }

}

You might be interested in
What is a unit to measure loudness
FinnZ [79.3K]

decibels i believe is the correct answer. hope it helps :)

3 0
2 years ago
Which of the following terms best describes the product development life cycle process?
RUDIKE [14]

Answer:

D

Explanation:

Evaluative

3 0
3 years ago
Read 2 more answers
Expresa tu reflexión sobre la necesidad de un código de etica para la IA (inteligencia artificial) , oponia sobre los bots en la
JulsSmile [24]

Answer:

Ethics in artificial intelligence and robotics are of greater importance today as machine learning or robots are put to use to benefit humans and also ti harm humans.

Explanation:

Ethics in robotics or artificial intelligence in sometimes referred to as "roboethics". It is very necessary in todays time because robots are made to interact with the society, the humans.

This is the key concern for ethics which is based on growing awareness of the requirement to regulate, the  advancements in the field of AI in the near future. The future law or regulations should be on the basis of some of the shared values such as privacy, freedom, security, respect for human dignity, non - military, inclusions, etc. Here, the uncertainty is also being recognized, the uncertainty to know the advancements of AI in the near future. Therefore the regulations and ethical dilemmas should be rethought in the middle.

4 0
3 years ago
A high school in New York (school A) is using videoconferencing technology to establish student interactions with another high s
Montano1993 [528]

Answer: This is private IP address

Explanation:

192.168.25.10 is a private IP address and is reserved for use only within an organisation so it cannot be used to communicate with the outside world. So in order to have videoconferencing they have to share their public IP addresses.

4 0
3 years ago
What CSS property do you use to determine whether flex items are displayed horizontally or vertically
Hoochie [10]

Answer:

Flex direction

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head.

The head (header) contains information such as version of HTML, title of a page, metadata, link to custom favicons and cascaded style sheet (CSS) etc.

On the other hand, the body of a HTML document contains the contents or informations that a web page displays.

Generally, the part of a HTML document where the cascaded style sheet (CSS) file is linked is the header.

A style sheet can be linked to an HTML document by three (3) main methods and these are;

I. External style.

II. Inline style.

III. Embedded (internal) style.

Flex direction is a CSS property that's used to determine whether flex items are displayed horizontally or vertically.

5 0
3 years ago
Other questions:
  • HELP PLEASE
    7·2 answers
  • A complete traversal of an n node binary tree is a(n)____ "operation if visiting a node is O(1)for the iterative implementation
    5·1 answer
  • Investments in data networks, ip addresses, routers, and switches are ________ because of their impact on productivity, security
    14·1 answer
  • How to interchange first half of the array with second half of array in python?
    9·1 answer
  • What are the two basic classes of active directory objects?
    14·1 answer
  • 27. If X and Y are int type variables,
    14·1 answer
  • Implement the Tollable interface. It provides one method, pay, that accepts an int (how many dollars to pay), and returns an int
    8·1 answer
  • what is the correct process for setting up a recurring project for the same client in qbo accountant?
    14·1 answer
  • What is cyber security ???​
    8·1 answer
  • Write A Code In Python
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!