Write a program that keeps reading integers from the user until he enters a negative number. The program should then display the following: • Number of non-zero integers entered (excluding the last value; the negative) • Sum of the integers divisible by 4 • The maximum number entered Using java Sample Run: Enter an integer, the input ends if it is negative: 16 30 0 5 08 -4 The number of non-zero integers: 4 The sum of integers divisible by 4: 24 The maximum number entered is: 30

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
I need answer within 20 minutes please please with my best wishes
Write a program that keeps reading integers from the user until he enters a negative number.
The program should then display the following:
• Number of non-zero integers entered (excluding the last value; the negative)
• Sum of the integers divisible by 4
• The maximum number entered
Using java
Sample Run:
Enter an integer, the input ends if it is negative: 16 30 0 5 08 -4
The number of non-zero integers: 4
The sum of integers divisible by 4: 24
The maximum number entered is: 30
Transcribed Image Text:Write a program that keeps reading integers from the user until he enters a negative number. The program should then display the following: • Number of non-zero integers entered (excluding the last value; the negative) • Sum of the integers divisible by 4 • The maximum number entered Using java Sample Run: Enter an integer, the input ends if it is negative: 16 30 0 5 08 -4 The number of non-zero integers: 4 The sum of integers divisible by 4: 24 The maximum number entered is: 30
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT