Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java class called OddEven The main program will have a for loop that will generate 10 random numbers. In the for loop, print

Write a Java class called OddEven The main program will have a for loop that will generate 10 random numbers. In the for loop, print out the random number. Keep track of whether each number is odd or even. After the for loop, print out the count of odd and even numbers.

Part of your program might be: int oddCount = 0; int evenCount = 0; // Write your for loop ... // After the for loop: System.out.println("oddCount = " + oddCount + " evenCount = " + evenCount);

Submit OddEven.java for this assignment.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions