Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

do it in java eclipse Question: The keypad on your oven is used to enter the des

ID: 643982 • Letter: D

Question

do it in java eclipse

Question: The keypad on your oven is used to enter the desired baking temperature and is arranged like the digits on a phone:
1   2   3
4   5   6
7   8   9
   0  
Unfortunately the circuit is damaged and the digits in the leftmost column on longer function. In other words, the digits 1, 4, and 7 do not work. If a recipe calls for a temperature that cannot be entered, then you would like to substitute a temperature that can be entered. Write a program that reads in a desired temperature. The temperature must be between 0 to 999 degrees. If the desired temperature do 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.
Your program should include at least a loop that lets the users repeat this calculation until the user says she or he is done. Your program should also check the input validation.

Explanation / Answer

#include 02 using namespace std; 03 04 int main() 05 { 06     int t1, t2, t3; 07 08     cout > t1 >> t2 >> t3; 10 11     if ((t1 != 1 && t1 != 4 && t1 != 7) && (t2 != 1 && t2 != 4 && t2 != 7) && (t3 != 1 && t3 != 4 && t3 != 7)) 12     { 13         cout