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]
3 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]3 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
man who is colorblind marries a woman who has normal color vision and is not a carrier of color blindness. If this couple has a
kirill115 [55]

Answer:

Each of their sons has around a 0% chance for being color blind.

they will have normal girls but they will be carriers

Explanation:

Since the man is colour blind and he donates the X- Chromosome that is the carrier to the woman, they will give birth to a daughter who is a carrier but not color blind. If the man donates the Y chromosome, then they will give birth to a normal male child who is not color blind neither is he a carrier

4 0
3 years ago
A commercial depicts a teenager on a skateboard vandalizing a brick wall. This is an example of:
Olenka [21]
Crime. Because vandalizing is a crime. And maybe in the commercial the narrator will say something like don't do crime or something.
6 0
3 years ago
Read 2 more answers
If johnny has 800 socks and john has 1000 more how much does john have
masya89 [10]
John has 200 more socks than Johnny
8 0
3 years ago
If we want to access files located in a directory on a remote server, which of these options would we use?
Ray Of Light [21]
DNS obviously...............
5 0
3 years ago
Read 2 more answers
1. To type a capital "C", you would use the ring finger of your left hand.
Anna11 [10]
False, keyboard, Hypertext Transfer Protocol
5 0
3 years ago
Read 2 more answers
Other questions:
  • Identify the four basic categories of hardware in a microcomputer system. system unit, modem, ram, and microprocessor system uni
    5·1 answer
  • Controlling access of information on the internet
    15·1 answer
  • My sister put my phone in the microwave and I'm pretty sure the battery blew up. I'm too scared to open the microwave. What do I
    11·1 answer
  • A single-user/single-tasking operating system allows only one user to perform one task at a time. A real-time operating system g
    13·1 answer
  • Reply emailing a student who is asking about audio materials​
    6·2 answers
  • How do cyber criminals target user’s end devices?
    11·2 answers
  • 8.5 Edhesive Code Practice
    14·1 answer
  • Which option on the Format tab is used to modify particular portions of the chart?
    13·1 answer
  • These brainly bots need to stop!!
    14·1 answer
  • [2]<br> (c) Describe how the microprocessor can determine when to sound the clock alarm.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!