Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

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_2

Step: 3

blur-text-image_3

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions