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
Delicious77 [7]
1 year ago
12

Write a print statement that displays a random integer between 5 and 5000. Assume the random library is imported.

Computers and Technology
1 answer:
Contact [7]1 year ago
4 0

Answer:

Explanation:

The following code is written in Java. It is a very simple three line statement (assuming that the random library was imported) that chooses a random integer value between 5 and 5000 and prints it to the screen using the println statement.

Random rand = new Random();

int randomNum = rand.nextInt((5000 - 5) + 1) + 5;

System.out.println(randomNum);

The random number generator is initialized and given a value between 5 and 5000. Since random number Generator will generate a number between 0 and the given value then subtracting 5 from the initial generated number makes sure that it is not more than 5000 and then adding 1 and 5 after wards makes sure that it is more than 5 always.

You might be interested in
In a system where Round Robin is used for CPU scheduling, the following is TRUE when a process cannot finish its computation dur
masha68 [24]

Answer:

B. The process will be terminated by the operating system.

Explanation:

When Round Robin is used for CPU scheduling, a time scheduler which is a component of the operating system is used in regulating the operation. A time limit is set for each of the processes to be run.

So, when a process fails to complete running before its time elapses, the time scheduler would log it off and return it to the queue. This queue is in a circular form and gives each of the processes a chance to run its course.

7 0
1 year ago
Which 2 problems does the Pay down credit card workflow solve for clients? (Select all that apply) It helps clients stay on top
Anna11 [10]

Answer:

B. It ensures that payments to credit card accounts are categorized correctly

D. It uses language that non-accountants can understand

Explanation:

Pay down credit card workflow is a new feature that makes entering records in QuickBooks easier for users. The two prime benefits of this workflow are;

1. It ensures that payments to credit card accounts are well categorized well. Without this feature, users most times find it difficult to enter records correctly or they tend to duplicate entries. This new feature obtains vital information that helps the software to correctly credit the accounts.

2. It uses language that non-accountants can understand. This simplifies the process and makes it easier for the user to enter the right data that would help the software to correctly credit the accounts.

3 0
1 year ago
Grabar microphone audio icon_person click each item to hear a list of vocabulary words from the lesson. then, record yourself sa
Vaselesa [24]

Because this is a on your own problem, it cannot be solved. You must speak to it after the person says something.

5 0
2 years ago
Read 2 more answers
Frank works for an organization that wishes to install a software program on a single server with multiple users connected. Whic
Helen [10]
The best answer to this question should be (A) Cloud Computing.

In general, cloud computing is the term used for the delivery of hosted services over the internet. We can also simply put cloud computing as the delivery of computing services like storage, servers, databases, software and more over the internet.




7 0
2 years ago
Write a loop that displays all possible combinations of two letters where the letters are 'a', or 'b', or 'c', or 'd', or 'e'. T
Dafna11 [192]

Answer:

for (char outerChar='a'; outerChar<='e'; outerChar++){

for (char innerChar='a'; innerChar<='e'; innerChar++){

cout << outerChar << innerChar << "\n";

}

}

3 0
1 year ago
Other questions:
  • Linda is making handouts for her upcoming presentation. She wants the handouts to be comprehensible to people who do not attend
    12·2 answers
  • In cell B16, enter a function to calculate the total attendance for the years 2014 through 2018 using the totals in the range B1
    10·1 answer
  • Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation
    6·1 answer
  • JAVAThe method longestStreak is intended to determine the longest substring of consecutive identical characters in the parameter
    7·1 answer
  • Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n
    7·2 answers
  • Delete Prussia from country_capital. Sample output with input: 'Spain:Madrid,Togo:Lome,Prussia: Konigsberg' Prussia deleted? Yes
    13·1 answer
  • With respect to the general classes of computers, a ________ is the most expensive and most powerful kind of computer, which is
    7·1 answer
  • A variable like userNum can store a value like an integer. Extend the given program to print userNum values as indicated. (1) Ou
    15·1 answer
  • Write a program that calculates taxi fare at a rate of $1.50 per mile. Your pro-gram should interact with the user in this manne
    12·1 answer
  • 4. Why does Hancock believe that our communication online is more honest than we might<br> expect?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!