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
Identify and explain 4 traditional (old ways) marketing approaches used by University uses in reaching
erastova [34]

Based on the information given, it should be noted that the traditional marketing techniques that can be used are:

  • Billboards.
  • Direct mail.
  • Signage.
  • Flyers.

<h3>What is marketing?</h3>

Marketing simply means they action that is used to promote one's business and it includes marketing research and advertising.

The traditional marketing approaches used by the University in reaching out to potential students without the medium of technology include Billboards, Direct mail, Signage, and Flyers.

Learn more about marketing on:

brainly.com/question/25369230

8 0
2 years ago
Tricking someone to reveal personal information, passwords, and other information that can compromise a security system is known
Ipatiy [6.2K]
<span>Social engineering is when a person convinces someone to reveal personal information and security system. Those people who use social engineering can trick people through telephone interactions, face-to-face interactions, and email or web interactions. In telephone interaction, they act like a technician but attempts to gather information from the victim. The person who uses face-to-face interactions is when the victim is interrogated to get information. And in email or web interactions, these social social engineering technique will send survey forms that asks personal information such as bank account.</span>
3 0
3 years ago
PACIFIC NORTHWEST
poizon [28]

Answer:

b) Tufts University Nutrition Web Page

Explanation:

The site that most likely provides a balanced information on eating a balanced diet is the Tufts University Nutrition Web Page

Tufts University is a moderate size, leading private research American higher education institution located in Massachusetts that offers degree programs on Food and Nutrition Policy and Programs

By comparison with the other sites which are;

a) Pork Producers Nutrition Page, which is expected to be related with pork production pork producers and pork consumers, based on the title focus, the information provided by the page is therefore, not meant for general use and therefore not meant to be balanced

c) The Eat What You Want Page, based on the of the page title literally which suggest the liberty for a user to eat what they want to eat does not appear to call for the input of an expert advice on nutrition, and therefore is not balanced.

8 0
3 years ago
One of the ways to create a horizontal navigation menu from an unordered list is to a. set the display property of the element w
Gennadij [26K]

Answer: a. set the display property of the element within each li element to inline

Explanation: In an unordered list, <em>ul</em> signifies the list and <em>li</em> signifies the elements in the list. When you want to display the elements in a list in a horizontal form, for example if you need a horizontal menu, a quick way of doing this is setting the display of li to inline by writing it as follows in css:

<em>li { </em>

<em>Display: inline; </em>

<em>} </em>

This will order the elements in the list into the form of a horizontal menu .

8 0
3 years ago
Imma say something random...
Fynjy0 [20]

Answer:

Uh I don't understand what you said.

Explanation:

N/A

5 0
3 years ago
Read 2 more answers
Other questions:
  • When doing a complex presentation, which of the following would be the best tool to begin designing your presentation?
    11·2 answers
  • During the past decade ocean levels have been rising faster than in the past, an average of approximately 3.1 millimeters per ye
    14·1 answer
  • Liz's meeting is scheduled to end at 9:30. It is 9:20 and team
    9·1 answer
  • What is the maximum transmission speed for bluetooth v3 and v4 devices?
    12·1 answer
  • The three tasks within data harmonization, namely: data consolidation, data cleansing, and data formatting use techniques called
    8·1 answer
  • Vector testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cr
    7·1 answer
  • Which type of NAC agent will be used during the posture assessment before allowing access to the VPN users?
    9·1 answer
  • What does RFID use for wireless communication?<br> Infrared<br> IoT<br> Smart chip<br> Tag
    14·1 answer
  • Tennis players are not allowed to swear when they are playing in Wimbledon
    6·2 answers
  • a value-returning method must specify as its return type in the method header. question 18 options: a) an int b) a double c) a b
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!