Write a method called randomNumber that takes as purumeter an integer n and returns a random integer between 1 and n inclusive that is a multiple of 3 (Hint: keep generating an integer using a loop...

i need the answer quicklyWrite a method called randomNumber that takes as purumeter an integer n and returns a<br>random integer between 1 and n inclusive that is a multiple of 3 (Hint: keep generating an<br>integer using a loop until a multiple of 3 is found).<br>Write a test program that reads from the user an integer greater than 20 then uses the<br>above method to generate five random integers (must use a loop). The program displays<br>the numbers generated.<br>Sample Run 1:<br>Enter an integer greater than 20: 40<br>| The random numbers generated as multiples of 3 are:<br>159 18 6 33<br>Sample Run 2:<br>Enter an integer greater than 20: 15<br>15 is not valid!<br>

Extracted text: Write a method called randomNumber that takes as purumeter an integer n and returns a random integer between 1 and n inclusive that is a multiple of 3 (Hint: keep generating an integer using a loop until a multiple of 3 is found). Write a test program that reads from the user an integer greater than 20 then uses the above method to generate five random integers (must use a loop). The program displays the numbers generated. Sample Run 1: Enter an integer greater than 20: 40 | The random numbers generated as multiples of 3 are: 159 18 6 33 Sample Run 2: Enter an integer greater than 20: 15 15 is not valid!

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here