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
Which type of operation writes the file system structure to the disk?
n200080 [17]
Formatting<span> writes the file system structure to the disk.</span>
8 0
3 years ago
1. W jaki sposób można wyrównać tekst po wstawieniu tabulatora?
Advocard [28]
I would say the correct answer is #1.
5 0
3 years ago
On what basis can you categorize the generations of computers
3241004551 [841]

what the answer to this question....


7 0
3 years ago
A__________is a system that incorporates all the technologies and applications found in a typical information system to gather,
Allisa [31]

Answer:

global information system (GIS)

Explanation:

A global information system (GIS) is an information system that works across national borders, facilitates communication between headquarters and subsidiaries in other countries, and incorporates all the technologies and applications found in a typical information system to gather, store, manipulate, and transmit data ...

6 0
3 years ago
In a computer spreadsheet, tool used to construct formulas is called *
zubka84 [21]

Formula bar is the tool used to contrust formula

3 0
3 years ago
Other questions:
  • Once Raul selects a technology solution, he has completed the process. <br> a. True<br> b. False
    13·2 answers
  • To reduce inflation, the Federal Reserve _____ the money supply. This action also causes the economy to shrink.
    13·2 answers
  • Which Internet Explorer security zone includes all Internet Web sites that are not specifically assigned to another zone?
    7·1 answer
  • Write a MARIE program to calculate some basic statistics on a list of positive numbers. The program will ask users to input the
    6·1 answer
  • Creating a chart using a spreadsheet Chart Wizard involves four steps. Which is the last step?
    6·1 answer
  • All of the following are used to fund private schools except ______
    14·2 answers
  • Importance of computer​
    15·1 answer
  • A video game controller contains the buttons: A, B, X, Y. When the player presses A their character Jumps. When the player press
    15·1 answer
  • A server is handling thousands of simultaneous connections, and proxying requests to another service. Which concurrency model is
    9·1 answer
  • St. CHarles school's music community is organizing a fundraiser. They want to create a simple but attractive website. However, t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!