Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi! I was wondering if someone could help with this Java assignment that I have. For this practice problem write a program that uses methods
Hi! I was wondering if someone could help with this Java assignment that I have.
For this practice problem write a program that uses methods to determine if a random integer is even or odd 1. 2. Start JGrasp Create a new file a. b. C. File -> New ->Java File ->save Name the file yourlastnamePractice10.java 3. Write a program that does the following: a. Use the Random class to generate a random integer i. Make sure to import java.util.Random ii. Random rand new Random(); ii. Int randNum rand.nextlnt(); b. Create a method called isEven that accept the random integer as an argument i. The method should determine whether the number is even or odd with the % operator Return true if the number is even and false if the number is odd ii. Use a for loop to generate 100 random integers and then total the number of odd values and the number of even values c. 4. 5. Run the program and test it Upload only the java file to D2L drop box folder named pp10Step 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