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
Which term best describes a network connection that uses the Internet to give mobile users or branch offices secure access to a
NNADVOKAT [17]

Answer:

Virtual Private Network (VPN)

Explanation:

A VPN can extend a private network over the internet securely to a mobile user or branch office. The traffic is encrypted between the private network and branch office or mobile users. VPN enables users to access and share resources like they were directly connected to the main network.

6 0
3 years ago
If you are inserting an address block with the Address Block dialog box and the fields do not connect automatically, what can yo
erica [24]

Answer: B

Explanation:

5 0
4 years ago
Read 2 more answers
1. Describe data and process modeling concepts and tools.
kow [346]

Answer:

data is the raw fact about its process

Explanation:

input = process= output

data is the raw fact which gonna keeps in files and folders. as we know that data is a information keep in our device that we use .

5 0
3 years ago
Read 2 more answers
Need help please will mark brainliest
aleksklad [387]

Answer:

intranet

Explanation:

An intranet is a private network that you can't access outside the physical boundary of an organization

7 0
3 years ago
If you're writing a timeline of a historical. What type of graphic organizer would you most likely choose to use in your rerouti
Tom [10]
I would use excel for a line graph.
8 0
4 years ago
Other questions:
  • Which term defines a star system with two stars?
    13·2 answers
  • Suppose you have a 12-hour clock on a very fancy chair (noon is 12 PM and midnight is 12 AM). Write a C++ program that reads in
    7·1 answer
  • ?an ip address reservation is made by creating an association between an ip address and what type of client identifier?
    7·1 answer
  • Brooke is trying to save enough money in the next fifteen months to purchase a plane ticket to Australia. Every month Brooke sav
    9·1 answer
  • At the frequency of 2.4 GHz what is the free-space path loss in dB.
    9·1 answer
  • What is one way that Accenture helps clients ensure fairness when applying AI solutions?
    13·1 answer
  • Select the one that uses the heading tag correctly. <br><br>a. <br><br><br>b. <br><br>c. <br><br>d.
    12·2 answers
  • There are three groups of people, people who like Apples, Bananas, and Cherries. 19 people like Apples. 23 people like Bananas.
    15·1 answer
  • 4.8.4 Better Sum
    15·1 answer
  • In balloon framing, the second floor joist sits on a horizontal framing member called a _____.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!