answer.
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
Alexeev081 [22]
2 years ago
15

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} java
Computers and Technology
2 answers:
xxMikexx [17]2 years ago
6 0
Import java.util.Scanner; public class StoreGuesses {   public static void main (String [] args) {
   public static void main (String [] args) {      Scanner scnr = new Scanner(System.in);
      Scanner scnr = new Scanner(System.in);      final int NUM_GUESSES = 3;
      final int NUM_GUESSES = 3;      int[] userGuesses = new int[NUM_GUESSES];
      int[] userGuesses = new int[NUM_GUESSES];      int i = 0;
      int i = 0;             for (i = 0; i < NUM_GUESSES; ++i) {         
                  userGuesses[i] = scnr.nextInt();
      }
       for (i = 0; i < NUM_GUESSES; ++i){         System.out.print(userGuesses[i] + " ");
         System.out.print(userGuesses[i] + " ");      }
      }       return;   }
   }}
}
Damm [24]2 years ago
3 0

Answer:

For displaying the number guesses in array user guess, first declare the number guess variable and set it to 3. After this, store the number guesses in array user guesses variables. Then declare the for loop and run till the number of guesses. Finally, print the number of guesses using print statement.

Further explanation:

Following is the JAVA program to populate the array user guesses with number guesses integers.

Code:

import java.util.Scanner;

//class definition

public class NumberGuesses

{

public static void main (String [] args)  

{

Scanner scnr = new Scanner(System.in);

//initialize the variable number guesses with 3

final int num_guesses=3;

//store the number guesses variable in an array

int[] user_guesses = new int[num_guesses];

int i = 0;

//for loop declaration

for (i = 0; i < num_guesses; ++i)

{

user_guesses[i] = scnr.nextInt();

}

for (i = 0; i < num_guesses; ++i)

{

//print the output

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

}

}

return;

}

Learn more:

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011

2. Prediction accuracy of a neural network depends on _______________ and ______________. brainly.com/question/10599832

3. The shape of our galaxy was determined ‘on the inside looking out' by surveying the milky way using ____________ telescopes. brainly.com/question/7866623

4. List 3 characteristics of the ideal encryption scheme. brainly.com/question/3000161

Answer details:

Grade: College Engineering

Subject: Computer Science and Engineering

Chapter: JAVA Programming

Keyword:

C Language, C++ language, JAVA, python, for loop, populate, array, read, scanner, class, num_guesses, user_guesses, enters, 9, 5, 2, variable, function, print, condition, true, false, return, system.out.print

You might be interested in
First, open two separate terminal connections to the same machine, so that you can easily run something in one window and the ot
dusya [7]
Dnt listen to da file shi
7 0
2 years ago
What is retrieved from a search containing two terms separated<br> by the AND operator?
egoroff_w [7]

Answer:

A AND B= 1 or 0

1 1  1

0 1  0

1 0  0

0 0 0

So, as explained above if both are 1 we then only get 1, or else we get 0 always in case of AND which is a logical operator, whose output can be 0 or 1 only. This is being depicted above.

Explanation:

If both are 1 we get 1 or always else, we get the output =0.

8 0
2 years ago
Of 500 sessions that occurred on a website during a one-week period, 200 of them started on the homepage; 100 of these 200 sessi
Elena L [17]

Answer:

the homepage bounce rate

Explanation:

Bounce rate is defined as the percentage of people that visits a page on a website and then exit or leave. That is, the visitors did not view any other page except the first one and they just leave the page after that visit. In order to get the bounce rate, the total number of visitors to a single page is taken and its then divided by the total number of visits to the website. For example, if the total number of visitors to a website over a period of time is 3000, while those that only visited a page on the website is 500, then the bounce rate is

(500/3000) * 100 = 16%

For this question, the homepage recorded 100 visited only once out of 200 which means homepage bounce rate is 50% : (100/200)*100

While website bounce rate is total number of bounces across the website/total visit to the website

100+100 =200 this is the total bounces across the website

200/500 :500 is the total visit to the website

(200/500)*100 = 40 %

Therefore the homepage bounce rate is higher than the site bounce rate

7 0
2 years ago
Terry came into work and turned on his computer. During the boot process, the computer shut down. When he tried again, the compu
kirza4 [7]

Answer: Something to do with the storage device, in this case most likely a HDD.

Explanation: Operating System files has somehow probably gotten corrupted during the boot process, or the system drive connection to the motherboard have been severed.

7 0
2 years ago
Compare the memory organization schemes of contiguous memory allocation and paging with respect to the following issues: a. Exte
Free_Kalibri [48]

Answer:

The comparison is based on memory organization schemes of contiguous memory allocation and paging with respect to External fragmentation, Internal fragmentation and Ability to share code across processes.

Explanation:

Memory organization schemes of contiguous memory allocation:

Contiguous memory allocation schemes suffers from external fragmentation. The reason is that address space is distributed contiguously and the holes and gaps keep growing when the old processes die and new processes are introduced. The variable size partition suffers from external fragmentation however the fixed size partitions do not suffer from external fragmentation. Contiguous memory allocation with variable size partitions does not encounter an internal fragmentation but with fixed size partitions suffers from internal fragmentation. Contiguous memory allocation does not support sharing code across processes. This is because the virtual memory segment of a process is not fragmented into non-contiguous fine grained blocks.

Paging:

Paging does not encounter external fragmentation as pages are of the fixed or equal size. So this reduces external fragmentation. However paging suffers from internal fragmentation. This is because a process can request more space or it can request for a less space. When page is allocated to the such a process that page is no longer utilized.This results in internal fragmentation because of the wastage of space even when the page has internal space but cannot be fully utilized. Paging allows to share code across processes.

5 0
2 years ago
Other questions:
  • Many organizations keep copyrighted information on their intranets, which is one reason usernames and passwords are required. Tr
    13·1 answer
  • Which one of the following is the best example of an authorization control? (a)- Biometric device (b)- Digital certificate (c)-A
    11·1 answer
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • When does the narrator of "EPIC 2015" say the "road to 2015" began?
    10·2 answers
  • Discuss the importance of following a well-integrated change control process on IT projects. What consequences can result from n
    14·1 answer
  • You are using a polynomial time 2-approximation algorithm to find a tour t for the metric traveling salesman problem. Which of t
    7·1 answer
  • Ciscon Telecom is a mobile operator in the European Union. The company provides personalized services to its customers, and its
    8·2 answers
  • 1)When the liquid is spun rapidly, the denser particles are forced to the bottom and the lighter particles stay at the top. This
    10·1 answer
  • A video game character can face toward one of four directions: north, south, east, and west. Each direction is stored in memory
    15·1 answer
  • How can migrating to an enterprise platform solution help a business improve employee productivity?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!