Question: Question 3: Write Program in Java with following features a. It has a method, which generates a random number n, from (1-10). [2] private static

 Question 3: Write Program in Java with following features a. It

Question 3: Write Program in Java with following features a. It has a method, which generates a random number n, from (1-10). [2] private static int randomNumber() b. It has a method which generates n ODD numbers starting from (50-99] and prints them on screen private static void oddGen(int n) [3] 1 [1] C. Call these methods in the main method to show the n prime numbers on the screen. Hints: random numbers can be generated with.random() methods from Math library or by creating an object from Random class, this requires importing Random class with java.util.Random command Sample Outputs: run:1 Random Number Generated = 1 51 run:2 Random Number Generated = 10 51 53 55 57 59 61 63 65 67 69

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!