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
raketka [301]
3 years ago
13

Random Star

Computers and Technology
1 answer:
Tatiana [17]3 years ago
3 0

Answer:

Explanation:

The following code is written in Java. The function takes in the random object and creates a random number where it generates a random number and prints out the * characters, if the random number and the input num are the same it prints out both values and ends the function.

import java.util.Random;

class Brainly {

   public static void main(String[] args) {

       Random r = new Random();

       randomStar(r, 12);

       System.out.println();

       randomStar(r, 19);

   }

   public static void randomStar(Random r, int num) {

       while (true) {

           int randomNum = r.nextInt(19) + 5;

           if (randomNum != num) {

               for (int x = 0; x < randomNum; x++) {

                   System.out.print("*");

               }

               System.out.print("\n");

           } else {

               for (int x = 0; x < randomNum; x++) {

                   System.out.print("*");

               }

               System.out.print("\n");

               System.out.println("Random Number: " + randomNum);

               System.out.println("Input Number: " + num);

               break;

           }

       }

   }

}

You might be interested in
Steve adds a second 1-GB 240-pin DIMM to his PC, which should bring the total RAM in the system up to 2 GB. The PC has an Intel
egoroff_w [7]

Answer:

Option A is correct.

Explanation:

He attaches the second 1 Gigabyte 240 pins DIMM for his system the overall RAM will be up around 2 Gigabytes. System is fitted with Intel Core 2 Dual 3-GHz cpu as well as three 240 pins DIMM ports on the motherboard. Transforms on a system, just 1 Gigabytes of RAM is seen through that RAM count.

Thus, the following issue is much more probably to be the failure to correctly grab that RAM.

5 0
4 years ago
Does using interior lighting help improve a drivers visibility at night
marin [14]
No, interior lighting makes less visibility for drivers. It becomes harder to see out the window.
8 0
4 years ago
_________ Code that you write is called primary code, and code that the compiler produces after processing the primary code is c
Kazeer [188]

Answer:

The correct answer for the given question is  "source code"

Explanation:

When you writing a code in any programming language that code is known as  source code.The source code is also known as primary code, when source code is compiles it produce runtime code.

The source code is created by the compiler it can be easily understood by the human being.

for example in c language we write a source code after compilation it produces object code .

5 0
4 years ago
What do you call the spreadsheet cell that is in effect and has a heavier black border around it?
valina [46]
The right answer is A<span>.Active cell </span>
4 0
3 years ago
Read 2 more answers
Under which menu option of a word processing program does a callout appear?
Juli2301 [7.4K]
A callout is a type of text box that also includes a line for pointing to any location on the document. A callout appears under the SHAPES <span>menu of the word processing program. The answer that completes this statement is the word "shapes". Hope this answers your question. </span>
7 0
3 years ago
Other questions:
  • Why is sequencing important in coding
    8·2 answers
  • I'm curious why I would need to know this on a school learning site.
    12·1 answer
  • Which error produces incorrect results but does not prevent the program from running?
    7·1 answer
  • Write the java statement to creat an object mp4 class digital​
    8·1 answer
  • While performing Before Operations PMCS, you notice the front right tire appears slightly underinflated. What is the proper acti
    11·1 answer
  • Problem: you need to write a code that read 2 array of size 10x10 of zero and ones that represent black
    8·1 answer
  • Compare and contrast an example of an actual company that has a brick and mortar location with an actual company that does not h
    8·1 answer
  • How to convert mkv to avi without losing quality?
    14·1 answer
  • What types of character Microsoft Excel understand​
    6·1 answer
  • Match the order in which you should develop a plan:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!