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
lozanna [386]
3 years ago
7

Complete the AscendingAndDescending application so that it asks a user to enter three integers. Display them in ascending and de

scending order.An example of the program is shown below:Enter an integer... 1 And another... 2 And just one more... 3 Ascending: 1 2 3 Descending: 3 2 1GradingWrite your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade.Once you are happy with your results, click the Submit button to record your score.
Computers and Technology
1 answer:
Andreas93 [3]3 years ago
5 0

Answer:

Following are the solution to the given question:

import java.util.Scanner;//import package

public class AscendingAndDescending//defining a class AscendingAndDescending  

{

   public static void main(String[] args) //main method

   {

       int n1,n2,n3,min,max,m;

       Scanner in = new Scanner(System.in);//creating Scanner class object

       System.out.print("Enter an integer: ");//print message

       n1 = in.nextInt();//input value

       System.out.print("And another: ");//print message

       n2 = in.nextInt();//input value

       System.out.print("And just one more: ");//print message

       n3 = in.nextInt();//input value

       min = n1; //use min variable that holds value

       max = n1; //use mix variable that holds value

       if (n2 > max) max = n2;//use if to compare value and hols value in max variable

       if (n3 > max) max = n3;//use if to compare value and hols value in max variable

       if (n2 < min) min = n2;//use if to compare value and hols value in min variable

       if (n3 < min) min = n3;//use if to compare value and hols value in min variable

       m = (n1 + n2 + n3) - (min + max);//defining m variable that arrange value

       System.out.println("Ascending: " + min + " " + m + " " + max);//print Ascending order value

       System.out.println("Descending: " + max + " " + m + " " + min);//print Descending order value

   }

}

Output:

Enter an integer: 8

And another: 9

And just one more: 7

Ascending: 7 8 9

Descending: 9 8 7

Explanation:

In this program inside the main method three integer variable "n1,n2, and n3" is declared that inputs value from the user end and also defines three variable "min, max, and m" that uses the conditional statement that checks inputs value and assigns value according to the ascending and descending order and prints its values.

You might be interested in
Just answer in five-line. Question:
Eddi Din [679]

Answer:

It is a half-duplex serial transmission mode, and this can be provided through the RS-485 two wired electrical interface. And this can be connected to the ethernet if required, connect to the LAN, and finally transmitting the video footage to all the screens. And the two reasons are:

1. Noiseless

2. Allows around 32 receivers.

Explanation:

Please check the answer.

3 0
3 years ago
Kiara is using her software's graphic formats to create a line graph. As she
rewona [7]

Answer:

Correct the data she entered, and the software will adjust the  graph.

Explanation:

Software is used to work with ease and efficiency. If there is any mistake during data entry, we can easily change that particular data and make it correct. There is no need to delete whole data and re enter the data again. As most of the software are user friendly and have the option to edit the information that already has been entered.

In mentioned case, Kiara should edit the data, that has been entered incorrect. After the correction of data, the graph will be automatically updated with new values and she found correct graph.

8 0
3 years ago
Read 2 more answers
Which kind of image is indispensable and needs added text to go with ?
Harrizon [31]

Explanation:

A map is the correct answer hope that helps you.

4 0
3 years ago
Write a statement that defines a double variable named result, initialized with the value 6.759.
In-s [12.5K]

Answer:

"double result=6.759;" is the correct answer for the above question.

Explanation:

  • In c-programming language, the double is a data type which stores the decimal value up to 6 decimal point.
  • This data type takes 8 bytes space in memory when it is used in the c-programming language.
  • When the user wants to declare the double data type, then he should need to declare by the help of the following syntax-- double variable_name_or _identifier_name;
  • When the user wants to declare the double data type and initialize the value on its then he can do this with the help of the following syntax--double variable_name_or _identifier_name= value_which_needs_to_store;
  • The above question asked the one-line statement which declares the result variable of double data type and initializes the "6.759" value on its then he can do this by the help of "double result=6.759;" statement which is described above. Hence the answer is "double result=6.759;".

3 0
3 years ago
A(n) ________ is a wonder of miniaturization combining a CPU, GPU, and sundry other support logic onto a single silicon die, sav
erma4kov [3.2K]

Answer:

system on a chip (SoC)

Explanation:

4 0
2 years ago
Other questions:
  • The one place where c++ allows aggregate operations on arrays is the input and output of c-strings.
    8·1 answer
  • .exe, .msi, .msp, .inf - together, what do these filetypes indicate
    12·2 answers
  • Which of the following loop conditions will read all the data in the file assuming that each line in the file contains two integ
    5·1 answer
  • How to cancel branly subscription??​
    8·1 answer
  • What was used to enhance silent films of the early 1900s
    15·1 answer
  • What is machine learning
    9·2 answers
  • How do you customize calendar view​
    9·2 answers
  • How is technology moving the business world forward?
    13·1 answer
  • It's generally best to use what types of sites for factual internet research? Select all that apply from the choices below.
    5·2 answers
  • allows users to enter text and control the computer with their voice.allows users to enter text and control the computer with th
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!