Using your knowledge on 1D arrays, create a small Java program that uses all of
ID: 441066 • Letter: U
Question
Using your knowledge on 1D arrays, create a small Java program that uses all of these concepts. This program should prompt the user for an integer number and then declare an array of floating point numbers of that size the user specified. This program should then fill in this array with random floating point numbers in the range of 0 to 100. Finally, the program should display the percentage of numbers within the array that are greater than or equal to 70.
Requirements
1) Read in an integer from the user (n)
2) Declare an array of floating point numbers of size n
3) Fill in this array with random floating point numbers between 0 and 100.
4) Calculate and display the percentage of values in the array that are at least 70
Hint: realize that although random.nextFloat() returns a float number between 0 and 1, but you can multiply this to get larger ranges.
Explanation / Answer
You need this. Kindly rate ,becuase I have spent a lot of time solving this :) int N = 20; //20 Random numbers int[] randomNumber = new int[N]; int[] answer = new int[N/2]; //Generate random numbers of size N for (int i = 0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.