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
Leto [7]
2 years ago
9

9.6 Code Practice: Question 1

Computers and Technology
1 answer:
worty [1.4K]2 years ago
8 0

Answer:

  1. import java.util.Random;
  2. import java.util.Arrays;
  3. public class Main {
  4.    public static void main(String[] args) {
  5.        int n = 10;
  6.        int [] myArray = new int[n];
  7.        buildArray(myArray, n);
  8.        System.out.println(Arrays.toString(myArray));
  9.    }
  10.    public static void buildArray(int[] arr, int n){
  11.        for(int i=0; i < arr.length; i++){
  12.            Random rand = new Random();
  13.            arr[i] = rand.nextInt(90) +10;
  14.        }
  15.    }
  16. }

Explanation:

Firstly, create a method buildArray that take two inputs, an array and an array size (Line 12). In the method, use random nextInt method to repeatedly generate a two digit random number within a for loop that will loop over array size number of times (Line 13-15). The expression rand.nextInt(90) + 10 will generate digits between 10 - 99.

In the main program, call the build array method by using an array and array size as input arguments (Line 8). At last, print the array after calling the buildArray method (Line 9).

You might be interested in
Which bus slot provides the highest video performance​
Sphinxa [80]

Answer: PCI, The PCI provides the highest performance

4 0
3 years ago
What is information technology?
nirvana33 [79]
Information technology is the application of computers to store, retrieve, transmit and manipulate data, often in the context of a business or other enterprise. 
7 0
3 years ago
A driving school uses this rule to estimate how many lessons a learner will require.
HACTEHA [7]

Answer:

This is correct. And to remove the confusion, I am adding the meaning of the Pseudocode. You need to begin with the algo that you are working upon, and then you need it to phrase the algo with the words which are easy to be transcribed in the form of the computer instructions. Now you need to indent the instructions properly inside the loop or within the conditional clauses. And while doing this, you need to not use the words which are used in certain forms of computer language. However, IF and THEN and ELSE and ENDIF are very frequently used as pseudo-code. Hence, your answer is correct.

Explanation:

Please check the answer section.

8 0
2 years ago
Difference between switch case and if else statement.​
ser-zykov [4K]

Answer:

<h3><em>SWITCH</em><em> </em><em>CASE</em><em>:</em></h3>

<em>☆</em><em> </em><em>STATEMENT</em><em> </em><em>WILL</em><em> </em><em>BE</em><em> </em><em>EXECUTED</em><em> </em><em>IS</em><em> </em><em>DECIDED</em><em> </em><em>BY</em><em> </em><em>USER</em><em>. </em>

<em>☆</em><em> </em><em>SWITCH</em><em> </em><em>STATEMENT</em><em> </em><em>EVALUATES</em><em> </em><em>ONLY</em><em> </em><em>CHARACTER</em><em> </em><em>《</em><em>OR</em><em> </em><em>》</em><em>INTEGER</em><em> </em><em>VALUE</em><em>. </em>

<em>☆</em><em> </em><em>IT</em><em> </em><em>USING</em><em> </em><em>SINGLE</em><em> </em><em>EXPRESSION</em><em> </em><em>FOR</em><em> </em><em>MULTIPLE</em><em> </em><em>CHOICES</em><em>. </em>

<h3><em>IF</em><em> </em><em>-</em><em> </em><em>ELSE</em><em> </em><em>STATEMENT</em><em>. </em></h3>

<em>☆</em><em> </em><em>STATEMENT</em><em> </em><em>WILL</em><em> </em><em>BE</em><em> </em><em>EXECUTED</em><em> </em><em>DEPEND</em><em> </em><em>UPON</em><em> </em><em>THE</em><em> </em><em>OUTPUT</em><em> </em><em>OF</em><em> </em><em>THE</em><em> </em><em>EXPRESSION</em><em> </em><em>INSIDE</em><em>. </em>

<em>☆</em><em> </em><em>IF</em><em> </em><em>THE</em><em> </em><em>STATEMENT</em><em> </em><em>EVALUATES</em><em> </em><em>INTEGER</em><em>, </em><em>CHARACTER</em><em>, </em><em>POINTER</em><em>《</em><em> </em><em>OR</em><em> </em><em>》</em><em>FLOATING-</em><em> </em><em>POINT</em><em> </em><em>TYPE</em><em> </em><em>《</em><em> </em><em>OR</em><em> </em><em>》</em><em>BOOLEAN</em><em> </em><em>TYPE</em><em>. </em>

<em>☆</em><em> </em><em>IF</em><em> </em><em>USING</em><em> </em><em>MULTIPLE</em><em> </em><em>STATEMENT</em><em> </em><em>FOR</em><em> </em><em>MULTIPLE</em><em> </em><em>CHOICES</em><em>. </em>

<em>HOPE</em><em> </em><em>IT</em><em> </em><em>HELP</em><em>.</em><em>.</em><em>.</em><em>.</em><em /><em /><em />

7 0
2 years ago
I am trying to figure out why I keep having the errors on the right side.
Y_Kistochka [10]

Shut down your computer and try again.

6 0
2 years ago
Other questions:
  • A technician wants to create a new partition on a new additional hard drive. what tool should be used?
    15·1 answer
  • The ____ function sums the numbers in the specified range and then divides the sum by the number of cells with numeric values in
    14·1 answer
  • Which of the following is a correct definition of the term rectification? A. Rectification is the opposition to current flow in
    14·2 answers
  • Que funcion tiene la sombrilla forrada de aluminio​
    6·1 answer
  • Which technique helps you look confident as a speaker?
    15·1 answer
  • 1.6 code practice: question 1 edhesive
    12·2 answers
  • Define time management and give two activities that you can do to help manage your tasks, homework, or projects better.
    12·1 answer
  • James has a USB flash drive that he has used at work. The drive needs to be thrown away, but James wants to make sure that the d
    12·1 answer
  • Explain the following terms <br><br>copyleft:<br><br>creative Commons:<br><br>GNU/GPL:​
    8·1 answer
  • What do you mean by Graphics editing​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!