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
Serhud [2]
3 years ago
8

Write a for loop to populate array userGuesses with NUM_GUESSES integers. Read integers using Scanner. Ex: If NUM_GUESSES is 3 a

nd user enters 9 5 2, then userGuesses is {9, 5, 2}.
Computers and Technology
1 answer:
Tema [17]3 years ago
5 0

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class num12 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Number of guesses");

       int NUM_GUESSES = in.nextInt();

       int [] userGuesses = new int[NUM_GUESSES];

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

           System.out.println("Enter each value");

           userGuesses[i]= in.nextInt();

       }

       System.out.println("userGuesses is "+ Arrays.toString(userGuesses));

   }

}

Explanation:

  • Prompt user to enter a value for the length of the array int NUM_GUESSES = in.nextInt();
  • Create an array of int int [] userGuesses = new int[NUM_GUESSES];
  • Use a for loop to request and add elements to the array
  • print the array using Arrays.toString () method
You might be interested in
I need some help with ideas
Troyanec [42]

Answer:

Maybe make a loud noise when there is an unacceptable speed

Explanation:

If you speed above the limit you will get a ticket to if it makes a loud noise you can be annoying and speed at the acceptable speed

5 0
3 years ago
The network layer of the ISO/OSI model organize bits into ..........​
galben [10]

Answer:

frames

Explanation:

The data-link layer is the second layer from the bottom of the OSI Model. The data-link layer's principal role is to identify errors and merge data bits into frames.

8 0
2 years ago
True or False: If you take a course and do not pass it, you still get credit. I feel like it's false but i'm not sure. Can I get
Margaret [11]
Its true because even if you fail a course it shows on your transcript....

8 0
3 years ago
Read 2 more answers
Which of the following is not a language commonly used for web programming?
DerKrebs [107]
The answer would be Assembly language as assembly language is not used for web development, but rather is a low level programming language.

Please mark branliest if this helped!!
7 0
4 years ago
Read 2 more answers
Where does append add the new elements?
ZanzabumX [31]

Answer:

"Option 1: To the end of an array." is the correct answer.

Explanation:

The word "Append" means adding to the end of a document.

Appending means whatever new content is added, it is added at the end of the document or data structure.

Similarly,

Appending an array means adding new elements to the end of the array.

Hence,

"Option 1: To the end of an array." is the correct answer.

7 0
3 years ago
Other questions:
  • In what year did commercial use of the Internet become available? 1991 1996 1999 2001
    9·1 answer
  • This semester we looked at three languages (C++, Java and Python). One common rule in all three class checklists (for C++, Java
    11·1 answer
  • What's the drawback of using Screened Subnet (DMZ)?
    12·1 answer
  • Why have countries requested for the removal of content?
    6·1 answer
  • In the circuit shown in the figure above, what will happen when switches S1 and S3 are both closed? 
    8·1 answer
  • Asymmetric key encryption combined with the information provided by a. certificate authority allows unique identification of the
    8·1 answer
  • Jennifer has written a short story for children. What should be her last step before she submits the story for publication?
    6·1 answer
  • Please helpppppppppp​
    8·1 answer
  • What is the best use of network in homes
    15·2 answers
  • Order the steps for creating an automatic reply in Outlook.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!