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
Delicious77 [7]
3 years 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]3 years 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
Boolean logic deals with statements having one of _____ values.
Alexxandr [17]

Answer:

2 values

Explanation:

boolean statements can only be True or False

6 0
3 years ago
Angela wants to give her press release an attractive and cohesive appearance. How can she quickly format her press release so it
I am Lyosha [343]

Answer:

Press release tools on websites

Explanation:

There are several tools on websites that provide quick press release. It is possible to directly select the style from several choices. Each style has own fonts and colors however, it is possible to change them.  

Step by step;

Angela may enter the website that provides press release

Then can select a theme with fonts and colors

Then she can put her work

It is ready to publish

8 0
4 years ago
Write the code to declare a variable to hold the value of the grade you hope to get in this class. What stdio.h input function w
GREYUIT [131]

Answer:

// code to read grade

#include <stdio.h>

// main function

int main(void) {

   // if grade is character

char grade;

// if grade is numeric then we can use int or double

// int grade;

// double grade;

printf("Enter your grade:");

// read grade from user

scanf("%c",&grade);

// print grade

printf("your grade is:%c",grade);

return 0;

}

Explanation:

To read a value, scanf() function is used from stdio.h.Read a grade from user and assign it to variable "grade".

Output:

Enter your grade:A

your grade is:A

// code to read die volt

#include <stdio.h>

// main function

int main(void) {

// variable

double die_volt;

printf("Enter die volt:");

// read die volt from user

scanf("%lf",&die_volt);

// print die volt

printf("Entered die volt is:%0.2lf",die_volt);

return 0;

}

Explanation:

Read the die volt from user and assign it to variable "die_volt" with the help

of scanf() function.

Output:

Enter die volt:220                                                                                                        

Entered die volt is:220.00

4 0
4 years ago
Write a JavaScript program to generate the following pattern but the number of rows should be user input.
Nookie1986 [14]

Answer:

Testicles

Explanation:

u sukkk

3 0
3 years ago
How do you uninstall sc update?
mihalych1998 [28]
You can't sorry, i dont like the update either :(
3 0
4 years ago
Read 2 more answers
Other questions:
  • What are three situations when recursion is the only option available to address problems?
    10·1 answer
  • What is data anayltics
    5·1 answer
  • What effect does screen resolution have on how graphics are displayed?
    7·1 answer
  • Write a JAVA program containing a method called hasEight(), which takes an int as input and returns true if the number contains
    14·1 answer
  • The __________ on a mouse is used to select or place the cursor where you want on the page
    13·1 answer
  • What type of error occurred??
    10·1 answer
  • Identify the parts of it, Give at least three web browser that you usually used to visit a website.​
    10·1 answer
  • When a client PC is booted, it broadcasts a __________________________ message over the network to locate DHCP servers on the sa
    13·1 answer
  • Real life example of hexadecimal and octal decimal “for example in binary light switch”
    6·1 answer
  • "The constructor signature is defined as the constructor __________ followed by the __________. (3 points)
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!