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]
3 years ago
9

9.6 Code Practice: Question 1

Computers and Technology
1 answer:
worty [1.4K]3 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
What year did polaroid introduce one-step photography with the SX-70
blagie [28]

Answer:

I first saw the Polaroid SX-70—the one-step instant camera introduced in 1972 by the company's co-founder, Dr.

Explanation:

5 0
2 years ago
Think about a career you would like to have 10 years from now.
WITCHER [35]

Answer: Scientist

Explanation: Scientists use technology to record data, as well as using technology to study different things, for example scientists use computers to track DNA.

6 0
2 years ago
¿Por qué es importante que lo países crezcan a nivel tecnológico?
IrinaK [193]

Answer:

Importancia de la tecnología en el crecimiento económico de los países. ... El desarrollo de estas vías tecnológicas aporta un aspecto positivo como el ahorro del tiempo, la disminución de los esfuerzos de los trabajadores que permite una economía progresiva.

Explanation:

4 0
3 years ago
How do you create a algorithm?
aksik [14]
Make sure that each box has an arrow going to it or leading from it, if it needs one. Select “Insert,” then “Shapes,” and choose the Text Box option: Page 2 [Algorithm how-to procedure] 2 Drag the cursor across the document to customize the size of the text box. Click inside the box to begin typing.
brainliest pls
6 0
3 years ago
Read 2 more answers
Luentifying message rullidl Upuuns
WITCHER [35]

Answer:

Plain text, Rich Text, and HTML format

Explanation:

In Outlook 2016, three formats are allowed. You can send the plain text only or you can send using the Rich text format. However, there is another sending format as well that is allowed, and it is the HTML format. And by default, if you will let the Outlook choose the most appropriate sending format then the email message will be sent using the HTML format.

7 0
3 years ago
Other questions:
  • Use a colon before a list and put one space after a colon. True False
    15·2 answers
  • Which database is more secure: the java-based apache derby or mysql?
    6·1 answer
  • The phrase has become an Internet buzz word. It refers to a top-level domain name for communications organizations.TrueFalse
    12·1 answer
  • Select the correct answer.
    6·2 answers
  • Which result is most likely if a network packet has no header?
    9·2 answers
  • What does cmyk stand for?
    5·2 answers
  • An article explaining the uses of the parts of a computer​
    14·1 answer
  • When you open a program, the hard drive
    7·1 answer
  • A location in memory which stores a value, the value can change as the program is running is
    12·1 answer
  • HELP ASAP, AND YES I KNOW, WRONG CATEGORY. SORRY!
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!