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
What are the primary functions of motor oil? a. Reduce friction and prevent wear b. Keep engine surfaces clean c. Remove heat to
ryzh [129]

The answer is E: all of the above.

7 0
3 years ago
Because one memory location can be used repeatedly with different values, you can write program instructions once and then use t
CaHeK987 [17]

Answer:

True.

Explanation:

The statement written in the question is True.We can use one memory location and use it with different values.

For example:- When we are using a loop be it for,while or do-while.The counter that we use for iteration is one and we use that counter to run the loop.We are using a single memory location and we are updating the count in that memory location many times.

for(int i=0;i<1000;i++)

{

     //body.

}

We are using i's memory location and changing it 1000 times.

3 0
3 years ago
What happens if a sequence is out of order?
andre [41]

Answer:

If you are trying to put the events in order and they are out of order you will probaly get the question wrong so make sure the events are in order.

Explanation:

6 0
3 years ago
Read 2 more answers
The replacement policy that can be implemented in practice and performs the best among the replacement policies that can be actu
scoundrel [369]

Answer:

The answer is "Least recently used policy".

Explanation:

It is the page replacement policy, which uses a less frequent substitute.  It adds a registry from each frame that includes the last time the program, that views within the frame, and use a "logical clock" for each of the data references, that made to change by a tick.

This replacement strategy is often used to substitute its least currently utilized cache line or page, and it is realistic and best implemented among the substitution policies.

6 0
3 years ago
First answer gets to be marked brainliest !!!!!
Ira Lisetskai [31]

Answer:

1.total access admin

2.total visual agent

3.total access analyser

4.total access detective

5. total access emailer

3 0
2 years ago
Other questions:
  • What is authentication?
    8·1 answer
  • Write a function with this prototype:
    8·1 answer
  • What is safe mode?
    9·1 answer
  • You create a new document and save it to a hard drive on a file server on your company's network. then you employ an encryption
    9·1 answer
  • Write another function to convert a value to its word equivalent leveraging the following tuple - o Number = (‘One’, ‘Two’, … ‘N
    10·1 answer
  • How do you close a file?
    12·2 answers
  • To provide for unobtrusive validation, you can install the ____________________ package for unobtrusive validation.
    11·1 answer
  • Find the total cost of a $125 coat purchased in Los Angeles County where the sales tax is 9%. Use the expression c + 0.09c
    10·1 answer
  • Which of the following screen elements is a horizontal bar that displays at the
    8·1 answer
  • Do you play Rocket League
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!