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
FinnZ [79.3K]
2 years ago
14

Create a program that allows the user to pick and enter a low and a high number. Your program should generate 10 random numbers

between the low and high numbers picked by the user. Store these 10 random numbers in a 10 element array and output to the screen.
In java code please.
Computers and Technology
1 answer:
Natalka [10]2 years ago
4 0

Answer:

import java.util.Scanner;

import java.util.Arrays;

import java.util.Random;

public class Main {

 public static void main(String[] args) {

   Scanner scan = new Scanner(System.in);

   System.out.print("Enter low: ");

   int low = scan.nextInt();

   System.out.print("Enter high: ");

   int high  = scan.nextInt();

   scan.close();

   int rndnumbers[] = new int[10];

   Random r = new Random();

   for(int i=0; i<rndnumbers.length; i++) {

     rndnumbers[i] = r.nextInt(high-low+1) + low;

   }

   for(int i=0; i<rndnumbers.length; i++) {

     System.out.printf("%d: %d\n", i, rndnumbers[i]);

   }

 }

}

You might be interested in
Using Amdahl’s Law, calculate the speedup gain of an application that has a 60 percent parallel component for (a) two processing
Nina [5.8K]

Answer:

a) Speedup gain is 1.428 times.

b) Speedup gain is 1.81 times.

Explanation:

in order to calculate the speedup again of an application that has a 60 percent parallel component using Anklahls Law is speedup which state that:

t=\frac{1 }{(S + (1- S)/N) }

Where S is the portion of the application that must be performed serially, and N is the number of processing cores.

(a) For N = 2 processing cores, and a 60%, then S = 40% or 0.4

Thus, the speedup is:

t = \frac{1}{(0.4 + (1-0.4)/2)} =1428671

Speedup gain is 1.428 times.

(b) For N = 4 processing cores and a 60%, then S = 40% or 0.4

Thus, the speedup is:

t=\frac{1}{(0.4 + (1-0.4)/4)} = 1.8181

Speedup gain is 1.81 times.

8 0
3 years ago
Will the fcc ruin the internet affect uk
n200080 [17]
No it will not the FCC is a federal owned company by the United States and has no control over any other servers outside of the US
3 0
3 years ago
The slide layout has placeholders for text, charts, and tables. true or false.
Ksju [112]
The answer to this is true
3 0
3 years ago
Read 2 more answers
You and three of your friends decide to hike the Appalachian Trail, a 2175-mile trail running from Georgia to Maine, starting wh
kozerog [31]

Answer:

The things to do:

a. Lie down flat.

b. Call your friend on phone to inform him of the situation, if he is not already aware.

c. Instruct him to call the rescue team and a helicopter ambulance.

d. Make a video call to your doctor and ask her for first aid instructions.  She can use HIPAA compliant video-conferencing tools to initiate consultations and treatment with you from the far distance.

e. Follow your doctor's instructions.

Explanation:

Telemedicine is the extension of medical services to patients in remote places.  This practise is facilitated by the use of telecommunication devices and telemedical equipment.  Telemedicine is made possible by technological advancements.  Many healthcare practitioners have embraced the practice and offer their patients telemedical services as the need arises.

Modern technology has enabled doctors to consult patients by using HIPAA compliant video-conferencing tools.

HIPAA stands for the Health Insurance Portability and Accountability Act of 1996, which was enacted by the 104th United States Congress and signed by President Bill Clinton in 1996.  The Act encourages Healthcare access to remote patients, medical consultation and treatment portability, and secures health information, among others.

7 0
3 years ago
Making phone calls with a public box
AfilCa [17]

Answer:

ja ok it is so eassssy.........................

8 0
3 years ago
Other questions:
  • Which tabs are expandable and collapsible? Check all that apply.
    7·2 answers
  • What bit position in an ascii code must be complemented to change the ascii letter represented from uppercase to lowercase and v
    14·1 answer
  • Double clicking a word selects the entire word?
    10·1 answer
  • How do you convert a decimal to binary?
    9·2 answers
  • ) How many switching functions of two variables (x and y) are there?
    11·1 answer
  • A user wants to make sure he can quickly restore his computer after a drive failure to the state it was in when Windows and all
    9·1 answer
  • I need help plzzzzzzzz
    10·2 answers
  • WHO WANTS TO PLAY AMONG US
    15·2 answers
  • Who innovated an aeroplane? ​
    5·1 answer
  • JAVA NEED HELP ASAP
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!