Question: Write a method called generate, which generates n random numbers in the range [a,b], where n, a, and b are inputs to the method and

Write a method called generate, which generates n random numbers in the range [a,b], where n, a, and b are inputs to the method and are integers. The method displays all generated numbers on one line and then displays "done" on next line. Run example: Assume we asked the method to generate 10 random numbers in the range [1,4], then it displays 3,4,1,2,3,3,2,2,2,1 done Note that there is no comma after the last displayed number. Validation: a should be less than b, otherwise, the function displays "invalid range" n should be larger than 0, otherwise, the function will by default produce 10 numbers. Method generate can be directly called from the main method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
