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
rosijanka [135]
4 years ago
11

Create a Visual Logic flow chart with four methods. Main method will create an array of 5 elements, then it will call a read met

hod, a sort method and a print method passing the array to each. The read method will prompt the user to enter 5 numbers that will be stored in the array. The sort method will sort the array in ascending order (smallest to largest). The print method will print out the array.

Computers and Technology
1 answer:
pogonyaev4 years ago
6 0

Answer:

See explaination

Explanation:

import java.util.Scanner;

public class SortArray {

public static void main(String[] args) {

// TODO Auto-generated method stub

Scanner sc = new Scanner(System.in);

System.out.println("Enter Size Of Array");

int size = sc.nextInt();

int[] arr = new int[size]; // creating array of size

read(arr); // calling read method

sort(arr); // calling sort method

print(arr); // calling print method

}

// method for read array

private static void read(int[] arr) {

Scanner sc = new Scanner(System.in);

for (int i = 0; i < arr.length; i++) {

System.out.println("Enter " + i + "th Position Element");

// read one by one element from console and store in array

arr[i] = sc.nextInt();

}

}

// method for sort array

private static void sort(int[] arr) {

for (int i = 0; i < arr.length; i++) {

for (int j = 0; j < arr.length; j++) {

if (arr[i] < arr[j]) {

// Comparing one element with other if first element is greater than second then

// swap then each other place

int temp = arr[j];

arr[j] = arr[i];

arr[i] = temp;

}

}

}

}

// method for display array

private static void print(int[] arr) {

System.out.print("Your Array are: ");

// display element one by one

for (int i = 0; i < arr.length; i++) {

System.out.print(arr[i] + ",");

}

}

}

See attachment

You might be interested in
What is Administrator windows 10
krek1111 [17]

An administrator in windows 10 is the account that could change option's that a guest user for example does in't have access to. For

Example: When a guest user tries to download a software via a guest account it will be asked to put a administrator password to be able to downlaod the software.

8 0
3 years ago
Which prefix indicates you are browsing a secure webpage
natka813 [3]

Answer is in the screenshot

4 0
3 years ago
Are Proxy Servers illegal if im using it to surpass Facebook or something because it is banned
Softa [21]
I don't think they are illegal, though you might get in trouble by administration

5 0
4 years ago
Do you agree that technology is always at the advantageous side wherein it only results in good things?
Crazy boy [7]

Answer:

No, think about mass surveillance in China (and in USA!), and the "social credit" system.

4 0
3 years ago
7) through: (0, 4) and (-1,0)​
Andreyy89

Answer:

its 5

Explanation:

7 0
3 years ago
Other questions:
  • 3.A customer has a system with a Gigabyte B450 Aorus Pro motherboard. He wants to upgrade the processor from the AMD Athlon X4 9
    11·1 answer
  • 11) Write the definition for a child class of Circle named Cylinder. The cylinder should have a double attribute named height. T
    12·1 answer
  • What is the process of designing green buildings called
    9·2 answers
  • How is the illusion of animation achieved using Sprites with multiple costumes?
    12·1 answer
  • An experienced user has installed Oracle VM VirtualBox on her workstation and is attempting to use it to create a virtual machin
    6·1 answer
  • What is employee Internet management (EIM) software?
    5·2 answers
  • you crossed two heterozygous red flowers (dominant color), what are your chances to have a white flower
    11·1 answer
  • Assignment 1: silly sentences edhesive
    7·1 answer
  • The person that includes the most and funniest memes (screenshot from the web) gets brainliest.
    5·1 answer
  • Becca is working on a program that will store data. The program will need quick access to data and data persistence is not impor
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!