Question: ( Boolean Functions ) The keypad on your oven is used to enter the desired baking temperature and is arranged like the digits on a

(Boolean Functions) 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 circuitry is damaged and the digits in the leftmost column no longer function. In other words, the digits 1, 4, 7 do not work. If a recipe calls for a temperature that cant 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.

Write a function named containsDigit to determine if a number contains a particular digit. The header should look like:

bool containsDigit (int number, int digit);

If number contains digit, then the function should return true. Otherwise, the function should return false. Your program should use this function to find the closest numbers that can be entered on the keypad.

(Call-by-reference Functions) Write a program that reads in a length in feet and inches and outputs the equivalent length in meters and centimeters. Use at least three functions: one for input, one or more for calculating, and one for output. Include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. Google for conversion between different units.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!