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
3 uses of a computer ​
GenaCL600 [577]

Answer:

online bills payment

watching movies or shows

home tutoring

3 0
2 years ago
Read 2 more answers
Top/Bottom Rules allow a user to apply conditional formatting to cells that fall within the top or bottom numbers or percentile.
Aliun [14]

C. TRUST

Explanation:

7 0
3 years ago
Read 2 more answers
QUESTION 6 Which of the following is a class A IPv4 address? a. 118.20.210.254 b. 183.16.17.30 c. 215.16.17.30 d. 255.255.0.0
shepuryov [24]

Answer:

a. 118.20.210.254

Explanation:

Here are the few characteristics of Class A:

First bit of the first octet of class A is 0.

This class has 8 bits for network and 24 bits for hosts.

The default sub-net mask for class A IP address is 255.0.0.0

Lets see if the first bit of first octet of 118.20.210.254 address is 0.

118 in binary (8 bits) can be represented as : 1110110

To complete 8 bits add a 0 to the left.

01110110

First bit of the first octet of class A is 0 So this is class A address.

For option b the first octet is : 183 in the form of bits = 10110111 So it is not class A address

For option c the first octet is 215 in the form of bits = 11010111 So it is not class A address

For option d the first octet is 255 in the form of bits = 11111111. The first bit of first octet is not 0 so it is also not class A address.

3 0
3 years ago
5.4.6: Rolling Dice code
ziro4ka [17]
It is 15 all together
4 0
2 years ago
How to connect on phpmyadmin?plss
Alex

Open your browser and go to localhost/PHPMyAdmin or click “Admin” in XAMPP UI. Now click Edit privileges and go to Change Admin password, type your password there and save it. Remember this password as it will be used to connect to your Database.

hope this helps!

5 0
2 years ago
Other questions:
  • Devices such as monitors and printers that are connected to a computer are called ________.
    12·1 answer
  • Why has unicode become the standard way of converting binary to text
    7·1 answer
  • System Architecture: Describe the system architecture. Specifically, be sure to address the corporate organization and culture,
    10·1 answer
  • What component has the job of managing data as it flows into and out of the places it needs to go?
    11·2 answers
  • Quick SearchLinks to an external site. lets you refine or narrow your search results using links on the right side of the screen
    5·1 answer
  • Whats the relationship between the CPU and motherboard
    6·1 answer
  • The first project that this position will work on is an embedded sensor that will send readings periodically to the cloud, and h
    9·1 answer
  • Research and recommend the most appropriate VPN technology. The most likely solution is either an Internet Protocol Security (IP
    5·1 answer
  • 1. What is hydrolics?​
    6·1 answer
  • In PowerPoint, a picture might be a photograph, a shape you draw, a piece of clip art, or an illustration created using a graphi
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!