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
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
Step by step
Solved in 4 steps with 2 images