First, think about what the signature of the method should be. Remember, each signature needs a return type, then the method name, then the list of parameters in a pair of parentheses. Each parameter requires a data type and a variable name for that data. Once you have a signature, compare your signature with a neighbor's signature to see if you're on the right track.
Next, think about how to generate random integers for specific ranges like [1,100], [5, 25], [10,99] etc. and look for a pattern to get the formula you need for [x,y]. Write code in your getRandomNum method to store the required random integer in a variable, and then use a return statement to return the value in that variable.
Finally, write a main method that calls the getRandomNum method to get a random number between 10 and 20, inclusive, and prints the result that is returned. Run your program at least 10 times and check the results to see if your code is working so far. Change the main method so you get a random number between 100 and 199, inclusive, and run your program again a number of times to check for correctness. Once you are convinced your program is working correctly, move on to the next step.
NOTE: The first random integer must have three digits, but the second random integer may not have 4 digits. Write code to deal with this in your main method. For example, if the first random integer is 392 and the second random integer is 54, then you want to print the phone number 392-0054.
for (int i = 1; i <= numberOfRepetitions; i++) { // code to repeat goes here }
For example, to print out "HELLO WORLD!" 7 times, you can write:
for (int i = 1; i <= 7; i++) { System.out.println("HELLO WORLD!"); }
(The variable i is a counter that starts at 1 and increments 1 each time the loop repeats while i is less than or equal to 7.)
Modify your main method so it prints out 10 random phone numbers.