Project 18: Broken Keypad. The keypad on your oven is used to enter the desired baking temperature and is arranged like the digits on a phone

Project 18: Broken Keypad. The keypad on your oven is used to enter the desired baking temperature and is arranged like the digits on a phone

LANGUAGE: Java

CHALLENGE:

Project 18: Broken Keypad. The keypad on your oven is used to enter the desired baking temperature and is arranged like the digits on a phone:
123
456
789
0

Unfortunately the circuitry is damaged and the digits in the leftmost
column no longer function. In other words, the digits 1, 4, and 7 do not work. If a recipe calls for a temperature that can’t be entered, then you would like to substitute a temperature that can be entered. Write a program that inputs a desired temperature. The temperature must be between 0 and 999 degrees. If the desired temperature does not contain 1, 4, or 7, then output the desired temperature. Otherwise, compute the next largest and the next smallest temperature that does not contain 1, 4, or 7 and output both.
For example, if the desired temperature is 450, then the program should output 399 and 500. Similarly, if the desired temperature is 375, then the program should output 380 and 369.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level