Skip to content
Advertisement

why is my method pickANumberPro() not working

I have created this program:

JavaScript

The program above runs, how can i convert this code above into a method, have main call it, and display the data of how many of each random number has been chosen? Below, is what i have started on.

JavaScript

edit:

JavaScript

Advertisement

Answer

This should fix your code.

JavaScript

Have fixed few things in code:

  1. Accept random object in pickANumberPro method
  2. print selectedNumber correctly
  3. Use scanner for getting keyboard input and use it
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement