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
elena-14-01-66 [18.8K]
3 years ago
11

Please help with coding assignment.

Computers and Technology
1 answer:
Inessa05 [86]3 years ago
4 0

Answer:

import java.util.Random;

class Main {

   

   public int stopAtFive (int j) {

      Random rand = new Random();

      int number = 0;

      for(int i=0; i<j; i++) {

          number = rand.nextInt(9)+1;

          System.out.println(number);

          if (number == 5) {

              System.out.println();

              break;

          }

      }

      return number;

   }

   

   public static void main(String args[]) {

       Main main = new Main();

       main.stopAtFive(20);

       main.stopAtFive(20);

   }

}

Explanation:

Your requirements do not say what has to be displayed or returned from the method, but you can use this as a starting point.

You might be interested in
The capacity of a communication channel is measured in _______.
PSYCHO15rus [73]
<span>The capacity of a communication channel is measured in gb and gps.</span>
4 0
3 years ago
Read 2 more answers
Fifty-three percent of U.S households have a personal computer. In a random sample of 250 households, what is the probability th
aleksley [76]

Answer:

The correct Answer is 0.0571

Explanation:

53% of U.S. households have a PCs.

So, P(Having personal computer) = p = 0.53

Sample size(n) = 250

np(1-p) = 250 * 0.53 * (1 - 0.53) = 62.275 > 10

So, we can just estimate binomial distribution to normal distribution

Mean of proportion(p) = 0.53

Standard error of proportion(SE) =  \sqrt{\frac{p(1-p)}{n} } = \sqrt{\frac{0.53(1-0.53)}{250} } = 0.0316

For x = 120, sample proportion(p) = \frac{x}{n} = \frac{120}{250} = 0.48

So, likelihood that fewer than 120 have a PC

= P(x < 120)

= P(  p^​  < 0.48 )

= P(z < \frac{0.48-0.53}{0.0316}​)      (z=\frac{p^-p}{SE}​)  

= P(z < -1.58)

= 0.0571      ( From normal table )

6 0
3 years ago
________ is malware that hijacks a user's computer and demands payment in return for giving back access.
Lera25 [3.4K]

Ransom  malware that hijacks a user's computer and demands payment in return for giving back access.

<h3>What is Ransom malware?</h3>

This is known to be a kind of  malware that hinders users from gaining in or access to their system or personal files and it is one that often demands ransom payment so as to get access.

Therefore, Ransom  malware that hijacks a user's computer and demands payment in return for giving back access.

Learn more about Ransom  malware from

brainly.com/question/27312662

#SPJ12

6 0
2 years ago
How is science and technology related?
garik1379 [7]
Because you use technology to do science
3 0
3 years ago
Read 2 more answers
In a transaction-processing system (TPS), if the TPS database can be queried and updated while the transaction is taking place,
neonofarm [45]

Answer:

Real time

Explanation:

Real-time data processing is the execution of data in a short time period, providing near-instantaneous output. The processing is done as the data is inputted, so it needs a continuous stream of input data in order to provide a continuous output.

6 0
2 years ago
Other questions:
  • System software falls into two categories: operating system software and ____ programs.â
    13·1 answer
  • Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;
    7·1 answer
  • What does it mean to have liability for a company?
    6·1 answer
  • Describe an ergonomic consideration for your body while working for long periods in front of a monitor or computer screen?
    14·1 answer
  • To locate all locations in a document with the word "employer" and replace it with "company," you should use the _____ function.
    8·1 answer
  • Pleaseeeeeeee tellllllllllllllllllllll​
    8·1 answer
  • Create an online order form for a car rental store and include the following items: input text box to enter the number of days i
    14·1 answer
  • What technology does kroger’s edge technology and amazon’s just walk out technology leverage?.
    15·1 answer
  • A(n) ____ is a live internet presentation that supports interactive communications between the presenter and the audience.
    13·1 answer
  • You want to store, organize, and manipulate your photos. what type of software do you need?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!