Flow Control 5

Description

The purpose of this challenge is to use if, nested ifs and while statements while using basic comparison operators

Requirements

  1. Use a while loop. As long as the user doesn’t enter a zero, perform the following:
  2. Display a message that asks the user to pick a number (negative numbers are ok)
  3. If the number entered is 404, display a message “Not found”
  4. If the number entered is 411, display a message “You can’t handle the information!”
  5. Note that in (3) and (4) above, you have to specifically handle each case separately.
  6. If the entered number is neither 404 nor 411, then do the following
  7. If the number is negative, display a message “The number is negative”
  8. If the number is divisible by 2, display a message “The number is even” otherwise display a message “The number is odd”
  9. ADDITIONALLY, if the number is divisible by 5, display a message “The number is divisible by 5”
  10. Remember, continue asking for input until the user enters a zero. When the user enters a zero, your while loop will terminate. Then, display a message “OK, we’re done here”

Sample Interaction / Output

Enter a number: -5
The number is negative

Enter a number: 411
You can't handle the information

Enter a number: 5
The number is odd
The number is divisible by 5

Enter a number: 404
Not found

Enter a number: 8
The number is even

Enter a number: 10
The number is even
The number is divisible by 5

Enter a number: 3
The number is odd

Enter a number: 0
OK, we're done here

LEGEND
PROGRAM OUTPUT
USER ENTRY 

CATALOG ID: CPP-FLOW0005

Print Requirements