Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started