Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- Prompt the user to enter a whole number and use a scanner to capture an integer num. - Create a string called description and
- Prompt the user to enter a whole number and use a scanner to capture an integer num. - Create a string called description and initialize it to an empty string ("'"); - Write if statements that will add the terms below to the description variable when the specified conditions are met: - Add "zero " if the number is zero. - Add "positive " if the number is greater than zero - Add "negative " if the number is less than zero - Add "small " if the absolute value of the number is less than 100 - Add "large " if the absolute value of the number is greater than or equal to 1,000,000. - Add "even " if the number is an even number(hint: use \% to detect if number is divisible by 2) - Add "odd " if the number is an odd number (hint: use \% to detect if number is divisible by 2) - Print out the "The entered integer N is a DESCRIPTION number", replacing N and Description with the actual values. - For example "The entered integer 5 is a small negative odd number" - For example "The entered integer 5000000 is a large positive even number
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