Question
(Intro to Java help?) Write a static method named evenNumbers that accepts a Scanner from the console. The method should repeatedly prompt the user to
(Intro to Java help?) Write a static method named evenNumbers that accepts a Scanner from the console. The method should repeatedly prompt the user to enter integers until 3 consecutive even integers are entered. When 3 consecutive even numbers are seen, the method should output a message including the total number of entries.
You may assume that the user will enter a single integer after each prompt. Here is a sample dialog of user interaction with the program.
Looking for three even numbers in a row.
Type a number: 44 Type a number: 15
Type a number: 23 Type a number: 2
Type a number: 12
Type a number: 34
Three even numbers found after 6 total entries
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