Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Minilabjava It should:
Ask the user to enter a nonzero integer see exact wording in the example below Keep asking the
user to reenter the integer as long as they do it wrong.
Once it is correct nonzero then ask the user to enter a number of nonnegative 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 of the first integer including EXACTLY 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 nonzero integer and then a series of
nonnegative 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 of the first integer.
Please enter a nonzero integer
Number cannot be zero; please reenter
Number cannot be zero; please reenter
Please enter doubles to analyze negative to stop
if expecting a double, java will automatically add the to make it a double
How many doubles were analyzed?
How many are greater than half of
How many are multiples of
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