Java Bootcamp Resources, launch
Make a function that returns a random number between 0 to 49999.
/** * Function name - randomNumber * @return (int) * * Inside the function * - returns a random number between 0 to 49999 * */
Create an array that stores 10 random numbers.
for loop to print every element on the same line. Leave one space between each element.
Here are the scores: 14775 48328 7928 27102 21787 21063 38096 42711 32863 23707
Your code contains a
int highScore = 0;
for loop to update the variable with the highest score in the array, and print it.
Hint: your loop needs a condition that updates the variable whenever an element is higher.
Visualizing the Runtime
After you solve this workbook, I still recommend watching the video solution on Udemy.
It will show you how to visualize the runtime using Visual Studio Code.