Create a program that do these: 1- Create an array of 10 int items 2- Fill this array using the method generateRandomNb with maximum number is 8. Create a program without using the method because i didn't take it yet just create the program with array and scanner maybe for loop if it's ok 3- Ask a user to give you a number between 0 to 8 4- Try to find this number in the array

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Create a program that do these:

1- Create an array of 10 int items

2- Fill this array using the method generateRandomNb with maximum number is 8. Create a program without using the method because i didn't take it yet just create the program with array and scanner maybe for loop if it's ok

3- Ask a user to give you a number between 0 to 8

4- Try to find this number in the array

import java.util.Random; In the main method

int randomInt;

Random rnum = new Random();

randomInt=rnum.nextInt(8);

For example: To fill an array MyNumbers: MyNumbers[i]= >>

i'm using java

Netbeans

i'm a beginner to java so i hope you explain every line so i can understand why you did and for print statement you should use it like the%d. /n something like this

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education