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]
4 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]4 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
What kind of sampling does a quasi experiment use?
Andrej [43]
A quasi experiment does not use completely randomized sampling where every participant in a certain sample would be allocated completely by chance and would have the same chance of becoming the member of a sample. Rather, quasi experiments have selective sampling where participants have been allocated to a certain sample by a certain criteria which makes the sample not completely random. 
5 0
4 years ago
How can you tell if a motherboard can be watercooled?
ivann1987 [24]
Well your cpu should have a header on it for a pump you can look for close to the cpu it should be little metal rods sticking up where you could connect a fan or a cooling device to!
3 0
4 years ago
ANSWER QUICKLIY
lidiya [134]

Answer:

Explanation:

Allow you to view the document in different ways. Sorry if I am wrong. I am dumb

God bless, stay safe, and good luck! :)

4 0
3 years ago
Read 2 more answers
N men and N women were participating in a stable matching process in a small town named Walnut Grove. A stable matching was foun
NeTakaya

Answer:

The simple algorithm is described below

Explanation:

assign all men and women as free

while some man m is free do

  w = highest ranked women on m's list

  if w is free

      then m proposes w and m and w are engaged

  else if w is not free and with m1

      and if w picks m over m1

          then w and m are engaged

          free m1

end

output all the pairs

4 0
4 years ago
What is technology? *
natta225 [31]

Answer: All of the above is the answer

4 0
3 years ago
Other questions:
  • Can a computer evaluate an expression to something between true and false? Can you write an expression to deal with a "maybe" an
    13·2 answers
  • Operating systems that have windows and icons have which type of user interface?
    15·1 answer
  • Which of the following is real job title on the interactive media career pathway?
    12·2 answers
  • Can you put iPhone voice memos on repeat?
    6·2 answers
  • • In your response, please include some examples of the three different types of storage.
    11·2 answers
  • What is the main type of energy used to help convert metamorphic rocks into igneous rocks in the rock cycle ?
    10·1 answer
  • Which argument forces a writer to return and change the input berfore resolving unicode erroe
    8·1 answer
  • Which of the following is the most important system if a company wants to consolidate fan data from multiple sources, i.e., exte
    11·2 answers
  • You can enter _____ in a cell to display tomorrow’s date
    12·1 answer
  • The paint 3D program is used for drawing picture true or false​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!