Complete the AscendingAndDescending application so that it asks a user to enter three integers. Display them in ascending and descending 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.

Answers

Answer 1

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.


Related Questions

Let a be an int array and let i and j be two valid indices of a, a pair (i,j) with i a[j]. Design a method that counts the different pairs of indices of a in disarray. For example, the array <1,0,3,2> has two pairs in disarray.

Answers

Answer:

Code:-

#include <iostream>

using namespace std;

int main()

{

   // take array size from user

   int n;

   cout << "Enter array size:";

   cin >> n;

   // Declare array size with user given input

   int a[n];

   

   // take array elements from user & store it in array

   cout << "Enter array elements:";

   for(int i=0 ; i < n ; i++){

       cin >> a[i];

   }

   

   /* ----- Solution Starts ----- */

   // i & j for checking disarray & count is for counting no. of disarray's

   int i=1, j=0, count=0;

   

   for(int k=0; k < n ; k++){

       

       if(a[i] > a[j]){

           // if disarray found then increament count by 1

               count++;

               

               }

               // increament i & j also to check for further disarray's

               i++;

       j++;

       }

       // Print the disarray count

   cout << "Pairs of disarray in given array:" << count;

   

   /* ----- Solution Ends ----- */

   

   return 0;

}

Output:-

What is the importance of using Onedrive in Windows 10 and how knowledge of it will have an impact in today's workplace?

Answers

The importance of one drive in windows 10 is that it helps the user to synchronize files in their computer.

Onedrive is a cloud storage system that is useful for the storage of files in a secured manner. A person can easily access their files whenever they want to.

In todays workplace a knowledge of onedrive has a great impact because

Onedrive offers an unlimited access to files whenever they are neededThe files can be available and accessed from anywhereIt helps with the organization of files in the work place.

One drive allows for this to be done even when offline. When online, there is an automatic synchronization of the made changes.

Read more at https://brainly.com/question/17163678?referrer=searchResults

Windows 10's one drive is useful because it enables users to synchronize information among various computers.Onedrive is indeed a cloud storage solution that can be used to store data in a secure environment.The user gets easy access to their files when their desire.In today's workplace, knowing how to use OneDrive is necessary because it gives unrestricted access to files anytime they're needed.The information can be transferred anywhere at.It assists with the arrangement of files in the workplace.It can be done and if you're not linked to the Network. Once you're online, the modifications you've performed are synchronized immediately.

Learn more:

brainly.com/question/24369537

Where does change management play a major role in transforming a client
business into a data-driven, intelligent enterprise?

Answers

To manage a modern IT environment characterized by hybrid complexity and exponential data growth — and to make that same IT a driver of growth and innovation for the business — you need to build intelligence into every layer of your infrastructure.

Change management plays a major role in transforming a client  business into a data-driven, intelligent enterprise in: data culture and literacy.

Data culture and literacy refer to all the processes involved in analyzing and understanding data within the framework of an organization.

The employees within such organizations are trained to read and understand data. It becomes a part of the organization's culture.

So data culture and literacy should be used when trying to transform a client  business into a data-driven, intelligent enterprise.

Learn more about data culture here:

https://brainly.com/question/21810261

6. Where all controls are lie
a) Properties b) Toolbox c) Solution Explorer d) Files

Answers

Answer:

I think b is correct answer.

Which are the best networking projects for a final year student in college

Answers

Answer:

The best networking project for a final year are Security issues with mobile IP.IP based patients monitoring systems.

explain the working principle of computer? can anyone tell​

Answers

Answer:

input process and output hehe

A _______ read inputs the first data item from a file. It typically appears immediately before the loop that processes the data from the file and inputs the remaining data from the file.

Answers

Answer:

the answer is priming read

Explanation:

hope it helps u

explain computer coding in an understandable manner​

Answers

Answer:

Coding is simply how we communicate with computers. Code tells a computer what actions to take, and writing code is like creating a set of instructions

Explanation:

Computer coding empowers kids to not only consume digital media and technology, but to create it. Instead of simply playing videogame or envision what their own website, or app might look like and they'll have the outlet for the expression

What is true about the pivot in Quicksort? Group of answer choices After partitioning, the pivot will always be in the center of the list. After partitioning, the pivot will never move again. Before partitioning, it is always the smallest element in the list. A random choice of pivot is always the optimal choice, regardless of input.

Answers

Answer:

The pivot is selected randomly in quick sort.

Components of micro computer with diagram

Answers

Answer:

CPU, Program memory, Data memory, Output ports,  Input ports and Clock generator.

Explanation:

There are six basic components of a microcomputer which includes CPU, Program memory, Data memory, Output ports,  Input ports and Clock generator. CPU is the central processing unit which is considered as the brain of the computer. It is the part of a computer that executes instructions. Data memory is the place where data is stored that is present in the CPU.

will social media lose its relevance?​

Answers

Judging from it's prevalence and popularity, there will be a long way to go until people start to lose interest with expressing themselves online. So no, social media will not lose its relevance, but maybe when technology is dead, then it will.

In database a record is also called a

Answers

Explanation:

hope it helps you

pls mark this ans brainlist ans

How do l write a program which countdown from 10 to 3​

Answers

Answer:

use loop

for(int i =10;i>2; i--)

{

System.out.println(i+"\n")

}

What is the importance of planning a web page before starting to create it?

Answers

The importance of planning a web page according to the question is provided below.

A well-designed company's website may contribute to making even your potential consumers a favorable immediate impression.

This might also assist people to cultivate guidelines and make additional transformations. Further significantly, it brings pleasant client interaction as well as allows customers to your website unrestricted access as well as browse easily.

Learn more about the web page here:

https://brainly.com/question/9060926

Fasilitas untuk pengaturan batas kertas pada Microsoft Word adalah….

a. Margin
b. View
c. LayOut
d. Paragraph

Office 92 sering disebut juga dengan….

a. Office 3.0
b. Office 7.0
c. Office Xp
d. Office 2.0


Answers

Fasilitas untuk pengaturan batas kertas pada Microsoft Word adalah

B.View

Office 92 sering disebut juga dengan

A.Office 3.0

A sinewave has a period (duration of one cycle) of 645 μs. What is the corresponding frequency of this sinewave, in kHz, expressed to 3 significant figures?


please help me figure this out I am so confused

Answers

The corresponding frequency of this sinewave, in kHz, expressed to 3 significant figures is: 155 kHz.

Given the following data:

Period = 645 μs

Note: μs represents microseconds.

Conversion:

1 μs = [tex]1[/tex] × [tex]10^{-6}[/tex] seconds

645 μs = [tex]645[/tex] × [tex]10^{-6}[/tex] seconds

To find corresponding frequency of this sinewave, in kHz;

Mathematically, the frequency of a waveform is calculated by using the formula;

[tex]Frequency = \frac{1}{Period}[/tex]

Substituting the value into the formula, we have;

[tex]Frequency = \frac{1}{645\; * \;10^{-6}}[/tex]

Frequency = 1550.39 Hz

Next, we would convert the value of frequency in hertz (Hz) to Kilohertz (kHz);

Conversion:

1 hertz = 0.001 kilohertz

1550.3876 hertz = X kilohertz

Cross-multiplying, we have;

X = [tex]0.001[/tex] × [tex]1550.39[/tex]

X = 155039 kHz

To 3 significant figures;

Frequency = 155 kHz

Find more information: https://brainly.com/question/23460034

Give examples of applications that access files by each of the following methods:
+ Sequentially.
+ Random.

Answers

Answer:

Explanation:

Usually, applications would have the capability of using either one of these options. But for the sake of the question here are some that usually prefer one method over the other.

Any program that targets an API usually uses Sequential access. This is because API's contain all of the data as objects. Therefore, you need to access that object and sequentially navigate that object to the desired information in order to access the data required.

A music application would have access to an entire folder of music. If the user chooses to set the application to randomly play music from that folder, then the application will use a Random Access method to randomly choose the music file to load every time that a song finishes.

WHICH PROGRAMMING LANGUAGES ARE THE BEST AND COMPATIBLE FOR 3D PRINTERS?

Answers

Answer:

G-code and C++ can be used

In order to print multiple worksheets, what needs to happen before printing?

Answers

Answer:

Explanation:

Click the File tab.

Click Print, or press the control p keyboard command.

On the Print screen, select the printer and other settings.

Click Print.

What is the output of this Python program, if the user types 3 as input?

Answers

0 1 2 will be the output of the function

What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sensitive information is stored in one secure place, or a distributed model, where information is spread around in many different places?

Answers


Co-Ordination Difficulty: ...
Waste of Resources: ...
Larger Interests of the Enterprise Neglected: ...
Emergency Decision not Possible: ...
Lack of Qualified Managers: ...
Certain Activities Decentralization not Possible:

Arrays are commonly used to store data items. Arrays can be managed in ways that fill, iterate over, add to, and delete items from the array. Why is it useful to store multiple pieces of information?

Answers

Answer:

mark me brainlist

Explanation:

How can an IS managers keep up with the endless demand for more software to support new information systems​

Answers

An IS manager can keep up with the endless demand for more software to support new information systems by thinking outside the box.

To think outside the box, the IS manager should try the following strategies:

Use predetermined application components that are operating on low-code or no-code platforms.Use better software-testing practices and tools that spread programming into small sprints.Engage in shift-left testing, which enables software-testing to be done at every phase of the development process.Involve product managers and business users at the beginning of software development, making them to drive innovation that satisfies their requirements.Finally, the IS manager can utilize AI and Machine Learning to speed up the development of required software, thereby enhancing its qualities and capabilities with reduced time and costs.

Thus, the IS manager must realize that there are always solutions to every software problem outside the mainstream box.

Learn more about information systems here: https://brainly.com/question/1521627

Mobile computing is growing in importance each and every day, and the IT manager must take that into account. Do some web research and develop a one-page description of the five most important things about HCI of mobile computing that the IT manager should know.

Answers

Answer:

phone grows everyday 82 percent

Explanation:

How does Accenture view automation?

Answers

Answer:

The description of the given question is summarized below.

Explanation:

These organizations retrained, retooled, and empowered our employees amongst all organization's internal management operating areas throughout order to create an increased automation attitude.Accenture's Innovative Software department was indeed adopting a concept called Human Plus technology, which includes this type of training.

Consider a DataFrame named df with columns named P2010, P2011, P2012, P2013, 2014 and P2015 containing float values. We want to use the apply method to get a new DataFrame named result_df with a new column AVG. The AVG column should average the float values across P2010 to P2015. The apply method should also remove the 6 original columns (P2010 to P2015). For that, what should be the value of x and y in the given code?

Answers

Answer:

x = 1

y = 1

Explanation:

The apply method has the axis argument which enables it to use the applied function either across the rows or columns, by passing the value 1 to the axis argument, the mean of at each index is calculated, (across the column) such that the length of the AVG column is equal to the lengtb of the original dataframe.

The drop method is used in pandas to remove row or column entry from a dataframe. To remove columns from a data table, the value 1 is passed to the axis argument of the drop method. Hence, passing 1 to the axis argument removes all 6 columns leaving only the AVG column in result_df.

How to overcome software quality dilemma

Answers

Explanation:

anytime software and business come together there is an inherent conflict between get it done fast and do a good job

You have n warehouses and n shops. At each warehouse, a truck is loaded with enough goods to supply one shop. There are m roads, each going from a warehouse to a shop, and driving along the ith road takes d i hours, where d i is an integer. Design a polynomial time algorithm to send the trucks to the shops, minimising the time until all shops are supplied.

Answers

Following are the steps of the polynomial-time algorithm:

Split the routes according to their categorizationAssuming that mid = di of the middle road, low = road with the least di, and high = road with the highest di, we may do a binary search on the sorted list.All shops must be approachable only using these roads for every road, from low to mid.Check if all shops can be reached from[tex]\bold{ low \ to\ mid+1}[/tex] using only these roads.There is a solution if every shop can be reached by road only up to [tex]\bold{mid+1}[/tex], but not up to mid.You can [tex]\bold{set \ low = mid+1}[/tex] if all businesses aren't accessible using both [tex]\bold{mid\ and\ mid+1}[/tex] roads.If every shop could be reached using both mid and mid+1, then set high to mid-1.With these layouts of businesses and roads, no response can be given because [tex]\bold{ low > high}[/tex]You can do this by [tex]\bold{set\ mid = \frac{(low + high)}{2}}[/tex]The new low, mid, and high numbers are used in step (a).

In a minimum amount of time, this algorithm will determine the best strategy to supply all shops.

Learn more:

polynomial-time algorithm: brainly.com/question/20261998

Write a pseudocode For loop that displays all the numbers from 0 to 5, one at a time. We have the following pseudocode so far. Declare Integer number Write this statement Display number End For Type the exact text for the line of pseudocode that should replace Write this statement shown above.

Answers

Answer:

The statement is:

For number = 0 to 5

Explanation:

Given

The incomplete pseudocode

Required

The loop statement to complete the pseudocode

To loop from 0 to 5, we make use of:

For number = 0 to 5

Where:

number is the integer variable declared on line 1

So, the complete pseudocode is:

Declare Integer number

For number = 0 to 5

Display number

End For

This method adds newValue to the list at the specified index. If the index is invalid for the list, throw an IndexOutOfBoundsException. Note that the last valid index is the size of the list; this would mean adding to the back of the list. Call any existing methods of LinkedList and LLNode as needed.

Answers

Answer:

i dont know

Explanation:

Other Questions
Which correlation best describes the data below. Louise has a hard time keeping her workspace clean at her job. She tries, but it just ends up getting messy again. Which of the following is a likely outcome of her consistent messiness? O a) She will have fewer safety issues. b) She will feel more productive. c) Customers will think she is very busy. O d) She will have a hard time focusing. please say me the correct answer How many numbers multiple of 3 are in the range [2,2000]? Describe how methane isformed in terms of chemical bonding How to find the unknown angles 21:(2 5) + ( 14) + 6.(8 4.3) what is the role of media in our society, and how can we become responsible consumers producers of news and information in the digital age? PLZZZZZ HELP. Place the following events in correct chronological order, from earliest to latest:A. Marshall Plan, Cuban Missile Crisis, McCarthyismB. McCarthyism, Marshall Plan, Cuban Missile Crisis1C. Cuban Missile Crisis, McCarthyism, Marshall PlanCD. Marshall Plan, McCarthyism, Cuban Missile Crisis Why did BP koirala wrote the story (A Tale) Giving brainliest, how old do you have to be to get a lip piercing in North Carolina, with parental consent. Ideas of cultural diversity and rejection of authority began to develop and change poetic themes during which period?O PostmodernO ModernO EnlightenmentO Classical The reference spheroid does not represent a completely accurate picture of the Earth's gravity because a. the lithosphere is generally weak. b. density is uniform within the Earth's layers. c. the surface of the Earth is not smooth. d. the asthenosphere is weak and allows for the lithosphere to rebound too quickly. A plaintiff sues her employer for sexual harassment. During the trial, the plaintiff attempts to introduce into evidence company records that include written complaints from other employees alleging that they too were sexually harassed by the employer. The defense objects to the admission of the records on the basis of hearsay. Should the objection be sustained? THIS IS A ECONOMICS QUESTIONLawns produce no crops but occupy more land (25 million acres) in the United States than any single crop such as corn or wheat. Does this mean the United States is producing inefficiently (inside the production possibilities curve)? Explain your answer. Din tch xung quanh ca hnh chp t gic u c cnh bng 6cm v di trung on bng 10cm l:A. 120 cm2 B. 240 cm2 C. 180 cm2 D. 60 cm2 Blood test can be used to check a person's blood glucose and hormone levels. The tabular column given below shows the result of two blood tests carried out on three people to check their blood glucose levels. Person 1 is healthy. A:- Compare the glucose levels of person 1 with the glucose levels of person 2 after fasting for 12 hours. B:- Compare the glucose levels of person 3 with the glucose levels of person 1, 2 hours after drinking 75g glucose. C:- Person 3 cannot be produce the hormone that control blood glucose levels. State the hormone that person 3 cannot produce. ( THE ORDER OF THE PHOTO IS:- person 1, and person 2, and person 3)Pls it is urgent Even though urban legends have many positive uses, they also have the potential to be negative. Explain why. Can I have help with this question (It's in the picture) Definecon tus propias palabras quienes son beneficiarios directosy beneficiarios indirectos de unemprendimiento