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]
3 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:
pogonyaev3 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 the correct html element for playing video files?
Neko [114]
HTML stands for Hyper Text Markup Language. It is the most commonly language used for <span>creating web pages and web applications. </span>

<span>The correct HTML element for playing video files is <video>.
</span>

To show a video in HTML, use the <video> element:

Example:<span><video<span> width="320" height="240" controls</span>></span>
  <span><source<span> src="video 1.mp4" type="video/mp4"</span>></span>
  <span><source<span> src="movie.ogg" type="video/ogg"</span>></span>
<span></video<span>></span></span>
4 0
2 years ago
Read 2 more answers
Grouping data in a report will (Points : 4) provide grand totals for your report.
zaharov [31]

Answer: Let you organize and summarize your data.

Explanation: Data grouping is referred as the making a collection or cluster of data in a report .The group is made for the summarization of the information and makes easily understandable according to the subject or field due to the proper organization.

Other given options are incorrect because it does not provide the total of the report content,attractive form of the data or editing function in report.Thus the correct option is summarizing and organizing the data.

3 0
2 years ago
Open Comments.java and write a class that uses the command window to display the following statement about comments:
riadik2000 [5.3K]

Answer:

Answers to the code are given below with appropriate guidelines on definitions and how to properly run the code

Explanation:

//3 ways to comment are as follows:

//1. This is a one line comment.

/**

* 2. This is a documentation comment.

* @author Your name here

*

*/

/*

*3. This is a multiple line comment

* */

public class Comments {

//Driver method

public static void main(String[]args) {

/*

* All the text written inside the

* sysout method will be displayed on

* to the command prompt/console*/

System.out.println("Program comments are nonexecuting statements you add to a file for the purpose of documentation.\n");

System.out.println("3 ways to add comments in JAVA are as follows: \n");

System.out.println("1. One line comment can be written as:\n//Program comments are nonexecuting statements you add to a file for the purpose of documentation.\n");

System.out.println("2. MultiLine comment can be written as:\n/* Program comments are nonexecuting \n * statements you add to a file for the \n * purpose of documentation.\n */\n");

System.out.println("3. Documentation comment can be written as follows:\n/**\n * Program comments are nonexecuting statements you add to a file for the purpose of documentation.\n **/");

}

}

Steps to Run:

1. Make file named Comments.java, and copy paste the above code.

2. Open command prompt and then go to the directory where you have saved the above created file.

3. The before running compile the code by using command

javac Comments.java

4. Now, run the code by the below command

java Comments.

Congrats your assignment is done!!

8 0
3 years ago
What would you need to have on your foley stage
LUCKY_DIMON [66]
<span>You will need many props for your Specific tracks (whatever you see in the film!). It's impossible to say what you will need until you see the picture and as time goes by you will add to your collection (if you have space!) - garbage day in my neighborhood is 'golden day' as I collect some of best props from the stuff people throw out: old bicycles, doors, sinks, wood, metal, desks, etc.</span>
4 0
2 years ago
.9 What is Artificial Intelligence?
Serhud [2]
C because bread is not happy with you
8 0
2 years ago
Other questions:
  • If you want to add a picture to your document, you can __________. (Select all that apply.)
    10·1 answer
  • What kind of device is a printer? output or input
    13·1 answer
  • The first time you save a document, which screen appears
    8·2 answers
  • The image below shows a weather service map
    13·1 answer
  • Pls help I will give lots of points
    9·1 answer
  • Use the syntax SELECT ________ (expression) [Column Name] to limit the result set to the number of rows defined by the expressio
    10·1 answer
  • Given N lines of input, print the 3rd character from each line as a new line of output. It is guaranteed that each of the n line
    8·1 answer
  • Write a program called array1.cpp file that use either regular for loop or range based for loop to display the contents of the a
    14·1 answer
  • What is also known as computer Network?
    6·2 answers
  • (03 MC)Why is it important to set goals and share them with others?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!