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
Higher Order Functions used for simulations of dice rolls. Definition: An n-sided dice function takes no arguments and always re
tiny-mole [99]

Answer:

#include <iostream>

#include <time.h>

#include <string>

using namespace std;

int main(){

srand(time(NULL));

cout<<"Throw dice"<<endl;

int b =0;

int a=0;

a=rand()%6;

b=rand()%6;

for (int i =0;i<1;i++)

{cout<<"dice one: "<<a<<endl;}

for (int i =0;i<1;i++)

{cout<<"dice two: "<<b<<endl;}

if(a>b)

{cout<<"first dice won"<<endl;}

if(b>a)

{cout<<"second dice won"<<endl;}

else{cout<<"they are same"<<endl;

return main();

}

return 0;

}

Explanation:

/*best dice roll game just for you change it as you want but all necessary things are there/*

5 0
3 years ago
An ISP is considering adding additional redundant connections to its network. Which of the following best describes why the comp
ozzi

Answer:

Redundant networks are generally more reliable.

Explanation:

6 0
3 years ago
It keeps saying “something is going wrong oops!” when i click on my brainly notifications what do I do
AveGali [126]

Answer:

check your app permissions it may be blocking them or try resetting the app

4 0
3 years ago
What is the purpose of a cover letter? Accompany a résumé to describe who you are and what you can do for the company Describe y
Vaselesa [24]

The answer is "Accompany a résumé to describe who you are and what you can do for the company". A cover letter should help sell you to the company, its information should tell them additional relivent information about you that may not be included on your resume.

8 0
3 years ago
EMERGENCY- I am giving 55 points for this, please help. WITH working out
lisov135 [29]

Answer:

360 kilobytes

Explanation:

(Time × Bitrate) / 8

30 × 96 = 2880 / 8

360 kilobytes

8: kilobits in a kilobyte

Time is always in seconds to obey the kb*ps* rule

Bitrate is always on bits so thats kilobits not kilobytes purpose of conversion

8 0
3 years ago
Other questions:
  • A short-circuit evaluation is where each part of an expression is evaluated only as far as necessary to determine whether the en
    14·1 answer
  • Using a "word" of 3 bits, list all of the possible signed binary numbers and their decimal equivalents that are representable in
    11·1 answer
  • 7.6 LAB: Checker for integer string Forms often allow a user to enter an integer. Write a program that takes in a string represe
    12·1 answer
  • True or False. Students taking courses log into Blackboard with their "key account" username and password.
    8·1 answer
  • In social networking websites such as twitter, people leave narrow minded and subjective remarks and upload unacceptable videos.
    9·1 answer
  • Trevor owns a manufacturing business that makes specialized hiking and rock climbing gear. He is a very small player in the mark
    8·1 answer
  • Of all excavation hazards, _______ poses the greatest risk
    8·1 answer
  • How to add if an statemement on a retrun in react js.
    14·1 answer
  • What is this on G00gel Documents , how do I fix it?
    15·1 answer
  • Write a program in Java programming language to display or calculate “Hello, Daddy and Mum”
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!