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
andreyandreev [35.5K]
3 years ago
5

Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The fi

rst integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers.Ex: If the input is 5 10 4 39 12 2, the output is: 2 4 10 12 39Your program must define and call the following method. When the SortArray method is complete, the array passed in as the parameter should be sorted.
Computers and Technology
1 answer:
Travka [436]3 years ago
5 0

Answer:

Explanation:

Since no programming language is stated, I'll use Microsoft Visual C# in answering this question.

// C# program sort an array in ascending order

using System;

class SortingArray {

int n; //number of array elements

int [] numbers; //Array declaration

public static void Main() {

n = Convert.ToInt32(Console.ReadLine());

numbers = new int[n];

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

{

numbers [n] = Convert.ToInt32(Console.ReadLine());

}

SortArray();

foreach(int value in numbers)

{

Console.Write(value + " ");

}

}

void SortArray()

{

int temp;

// traverse 0 to array length

for (int i = 0; i < numbers.Length - 1; i++)

// traverse i+1 to array length

for (int j = i + 1; j < numbers.Length; j++){

// compare array element with all next element

if (numbers[i] < numbers[j])

{

temp = numbers[i];

numbers[i] = numbers[j];

numbers[j] = temp;

}

}

}

You might be interested in
Home communication involves controlling systems such as heating, cooling, and security.
katen-ka-za [31]

Answer:

<em>A. True</em>

Explanation:

<em>Home communications involves automating home. It includes controlling the air-con,water heater, webcam, etc. A</em>

6 0
3 years ago
Changes in computer technology have an effect on _____.
dlinn [17]

Answer: Changes in computer technology have an effect on everyone.

6 0
3 years ago
1) "Information systems are revolutionizing the way businesses function in the 21st century," Do you agree or disagree with this
alukav5142 [94]

Answer:

true

Explanation:

everything is computerized. banks, shopping, financial business records, ect

7 0
2 years ago
Which is true of ASCII and Unicode?
allochka39001 [22]

Answer:

The correct options is;

Every character written in A S C I I can be represented using Unicode

Explanation:

All characters found in A S C I I can be found in Unicode such that A S C I I is a subset of Unicode whereby the meaning of the numbers from 0 to 127 are the same in both A S C I I and Unicode

The size of the A S C I I character in 8-bit A S C I I encoding is 8 bits while a Unicode U T F - 8 encoding has between 8 bits (1 byte) and 32 bits (4-bytes)

A S C I I assigns only 127 of the 255 possible numbers that can be stored in an 8-bits character, where the spare characters are then used by P C s for accented characters, therefore, it A S C I I does not define accented characters

4 0
3 years ago
The name of a .java file should ______________________________. Always match the name of the Class inside Should always start wi
natita [175]

Answer:

The name of a .java file should <u>always match the name of the class inside.</u>

Explanation:

In Java programming the program written in code editor is first saved with .java extension. The name of this .java file should be same as that of  the class declared inside the file.

This .java file is then compiled and  converted to .class file which contains the java bytecode. This bytecode can then be executed by java virtual machine(JVM).

However it is not always necessary that name of .java files should be same as that of class inside it. The name should be same only when the class inside is declared as public.

In case it is not declared as public one can name .java file different than the actual class name.  

7 0
3 years ago
Other questions:
  • Chris has just graduated from high school. He hopes to complete a carpenter's apprenticeship and eventually open his own busines
    9·2 answers
  • Typically, a CLEP exam is taken by students who
    8·1 answer
  • Let's say you're creating a search stream in your hootsuite dashboard, to find mentions of the phrase vacation holiday getaway.
    15·1 answer
  • Where is authorization management app on tablet?
    7·1 answer
  • Write a program to read data from a file named problem 2. ext. This file has three exams data (floating point data) in three col
    11·1 answer
  • Select the recommended design practice that applies to a web site using images for main site navigation.
    7·1 answer
  • A(n) ________ is a special value that cannot be mistaken as a member of a list of data items and signals that there are no more
    9·1 answer
  • how do I delete my brainly account, my child signed up for it and nothing has been paid but I do not want the account to exist a
    7·2 answers
  • In which situation would saving a Word document as a PDF be most useful?
    9·2 answers
  • State the base of correct addition of 27 + 6 =34​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!