65 863
Assignments Done
99,1%
Successfully Done
In October 2018

Answer to Question #57120 in Java | JSP | JSF for Eleni

Question #57120
Hello! Exercise: Write a class called RandomGeneratorImproved that expands RandomGenerator, which is able to generate random numbers coming from the sets of: a. first numbers, b. powers of 2(not negative int), c. Fibonacci numbers and d. square numbers. Create 2 new methods that are similar to "nextInt" method like (public int nextPrime(int n)) and public int nextPrime(int low, int high)). If there is no prime number in that range, it should show a message saying that and return -1. In the same way you should do all the methods for a., b., c., d. Write a program to test it where the user asks for what kind of random number he wants and within what range (low, high) and the result of it is a RANDOM number. Do not use ARRAYS or any method that saves the numbers in lists. Thank you in advance!
Expert's answer

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions