Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

How does a firm encourage and protect new ideas?

Answered: 1 week ago