Question
1. 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
1. 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. 2. 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). 3. The user will be able to keep entering the doubles to analyze until entering a negative one (which is the signal to stop). 4. 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.
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