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
vova2212 [387]
3 years ago
5

Write a program that requests the user for three decimal test scores between 0 and 100. Your program will then find the average

of the two highest scores. You are to use three separate IF statements to determine which score is the smallest. The average is to be formatted to one decimal place.
Computers and Technology
1 answer:
skad [1K]3 years ago
3 0

Answer:

import java.util.Scanner;

public class num9 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter three numbers between 0 and 100");

       double num1 = in.nextDouble();

       double num2 = in.nextDouble();

       double num3 = in.nextDouble();

       double min = 0;

       double sMin = 0;

       double tMin = 0;

       if(num1<num2 && num1<num3){

           min = num1;

           sMin = num2;

           tMin = num3;

       }

       else  if(num2<num1 && num2<num3){

           min = num2;

           sMin = num1;

           tMin = num3;

       }

       else  if(num3<num2 && num3<num1){

           min = num3;

           sMin = num1;

           tMin = num2;

       }

       double average = (sMin+tMin)/2;

       System.out.printf("The average of the two highest scores is:%.1f \n",average);

   }

}

Explanation:

  1. Using Java programming language. The Scanner class is used to receive the three numbers. The user is prompted to enter a valid number between 0 and 100.
  2. Using three IF statements the minimum (min), second largerst (sMin) and the largest (tMin) of the three numbers is determined.
  3. the average of the sMin and tMin is calculated and printed to the console with the printf method to one decimal place.
You might be interested in
Who was making the high-pitched growling noise that Francisco hears?
Gwar [14]

The high-pitched growling noise that Francisco hears is due to mating call of male midshipman fish or 5G.

<h3>What is the  hum about?</h3>

The Hum is known to be a kind of unexplained happenings that has brought a lot of irritations to people. It is known to be a high-pitched noise that brought a lot of scientific theories.

Studies has shown that the high-pitched growling noise that Francisco hears is as a result of  mating call of male midshipman fish or 5G.

Learn more about noise from

brainly.com/question/2278957

8 0
2 years ago
1. ¿Qué es un cursograma?
erma4kov [3.2K]

Answer:

Un cursograma permite representar gráficamente procedimientos administrativos. Constituyen instrumentos importantes para la visualización global y esquemática del conjunto de tareas administrativas.

6 0
3 years ago
Read 2 more answers
A. The client is running in a loop:
Ierofanga [76]
Aaaaaaaaaaaaaaaaaaaaaaaaaaaa
4 0
3 years ago
Write a function called min that returns the minimum of the two numbers passed in as parameters.
Kitty [74]

def min(x,y):

   smallest = x

   if y < smallest:

       smallest = y

   return smallest

x = min(2,1)

print("The min is "+str(x))

Although I wouldn't recommend using the name min for a function because min is the name of an existing function. Best of luck.

4 0
3 years ago
In the MARS Marketing Management Simulation, the results of your marketing mix decisions:
azamat
C- are only occasionally affected by the decisions made by other teams
explanation
idk
3 0
3 years ago
Other questions:
  • Jesse purchases a new smartphone and is immediately able to use it to send a photo over the Internet to a friend who lives in a
    12·1 answer
  • design the psuedocode for a program that allows a user to enter 10 numbers, then displays them in the reverse order of their ent
    6·1 answer
  • Possible consequences for plagiarism, listed in CAVA's Academic Integrity Policy, may include:
    9·1 answer
  • 100 POINTS PLEASE HELP ASAP!!!!!
    5·2 answers
  • What does Putting a word in quotation marks on your search bar do on google?
    12·1 answer
  • Hide Time Remaining A
    11·1 answer
  • Clarissa is a computer programming consultant. When a client states that they have an extremely complex programming task, which
    10·2 answers
  • The concept of taking traffic that’s all aimed at the same node and delivering it to the proper receiving service is known as
    8·1 answer
  • Amogus :0) owo have a good day y'all
    12·1 answer
  • What is control structure write it's types​ .
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!