Answered step by step
Verified Expert Solution
Link Copied!

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 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
image text in transcribed

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago

Question

4. Explain the strengths and weaknesses of each approach.

Answered: 1 week ago