Question: Your program: should be named Minilab _ 1 , java It should: Ask the user to enter a non - zero integer ( see exact

Your program: should be named Minilab_1,java It should:
Ask the user to enter a non-zero integer (see exact wording in the example below). Keep asking the
user to re-enter the integer as long as they do it wrong.
Once it is correct (non-zero), then ask the user to enter a number of (non-negative) doubles to
analyze by comparing each one to the first integer (again, see the exact wording below),
The user will be able to keep entering the doubles to analyze until entering a negative one (which is
the signal to stop).
As the doubles to analyze are entered, your program should count how many have certain properties
compared to the first integer. It should count:
how many doubles were analyzed?
how many are GREATER THAN half of the first integer?
how many are MULTIPLES of the first integer?
how many are within 5 of the first integer (including EXACTLY 5 from the first integer)?
After the negative double is received to end the input, print the counts in the exact format shown in the
example below.
Sample Example (user input is shown in bold):
This program will receive a (non-zero) integer and then a series of
(non-negative) doubles. It will count how many doubles are received,
count how many doubles are greater than half of the first integer,
count how many doubles are multiples of the first integer,
and count how many doubles are within 5 of the first integer.
Please enter a non-zero integer
0
Number cannot be zero; please reenter
0
Number cannot be zero; please reenter
6
Please enter doubles to analyze (negative to stop)
2.0
4.1
5.3
12.0
18// if expecting a double, java will automatically add the .0 to make it a double
How many doubles were analyzed? 5
How many are greater than half of 6?4
How many are multiples of 6?2
 Your program: should be named Minilab_1,java It should: Ask the user

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!