Concept explainers
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, 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
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.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Problem Solving With C++ (Looseleaf) - With Access
Additional Engineering Textbook Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with C++: Early Objects
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Java: An Introduction to Problem Solving and Programming (7th Edition)
- Write a program that accepts a number corresponding to a plane figure: 1. Right Triangle 2. Rectangle 3. Circle The program will then ask for the following: base and height – if the previous input is 1 (right triangle) width and length - if the previous input is 2 (rectangle) radius - if the previous input is 3 (circle) If the user inputs 3(figure), 4.0(radius) Resulting area = 50.27, circumference = 25.13arrow_forwardWrite the pseudo code for this problem based on what you learned from the video. The purpose is to design a modular program that asks the user to enter a distance in kilometers and then converts that distance to miles. The conversion formula is as follows: Miles = Kilometers x 0.6214arrow_forwardIn this program, you are asked to write a program in assembly which works as a simple calculator.The program will get two integer numbers, and based on the requested operation, the result shouldbe shown to the user.a. The program should print a meaningful phrase for each input, and the result.i. “Enter the first number”ii. “Enter the second number”iii. “Enter the operation type”iv. “The result is”b. The user should enter 0, 1, and 2 to tell the program the types of operation add, sub, andmultiply, respectively.c. How many registers do you need to implement this program?d. What system calls do you need to write this program?arrow_forward
- Write a program which prompts the user for a Celsius temperature, convert the temperature to Fahrenheit, and print out the converted temperature. Write a program which prompts the user for a Celsius temperature, convert the temperature to Fahrenheit, and print out the converted temperature.arrow_forwardDesign a program that will display an inches –to-centimeters conversion table. The smallest and largest number of inches in the table are input values. Your table must give conversions in 6-inch intervals. Treat the largest number of inches as a cap. That means that if the next inch value to be calculated (when counting by 6) is greater than the largest input, then that next inch value is not converted and does not appear on the table. One inch is equivalent to 2.54 cm. Display the output to 2 decimal places and right align both columns of output. It is in C not C++, it also needs to use a while looparrow_forwardDesign a program that will display an inches –to-centimeters conversion table. The smallest and largest number of inches in the table are input values. Your table must give conversions in 6-inch intervals. Treat the largest number of inches as a cap. That means that if the next inch value to be calculated (when counting by 6) is greater than the largest input, then that next inch value is not converted and does not appear on the table. One inch is equivalent to 2.54 cm. Display the output to 2 decimal places and right align both columns of output.arrow_forward
- Write a computer program for calculating carburization heat treatments. The program should ask the user to provide an input for the carbon concentration at the surface (cs), and the concentration of carbon in the bulk (c0).arrow_forwardWrite a program that accepts a number corresponding to a plane figure 1. Right Triangle 2. Rectangle 3. Circle The program will then ask for the following base and height - if the previous input is 1 (right triangle) width and length - if the previous input is 2 (rectangle) radius - if the previous input is 3 (circle) If the user inputs 4(figure) Displays "invalid input", then terminatesarrow_forwardThe program you write has to be something similar to this program, except that this program is for rolling LEDs (i.e the lights turn on one by one without any of them turningarrow_forward
- Write a program the lets the user input the resistance of four resistors in a circuit.Process the input and output the total resistance of the four resistors when connected in series.Process the same input and output the total resistance of the four resistors when connected in parallel.HINT: Read the PHOTO attached below to learn more about how total resistance is computed.arrow_forwardI am very confused on how to write this. Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and converts it to Celsius by subtracting 32 from the Fahrenheit value and multiplying the result by the double 5.0/9.0. Display both values to one decimal place. For example, if 88.5 degrees is input, the output would be: 88.5 F is 31.4 Carrow_forwardWrite a program that prompts the user to input three positive angle values in degrees to determine which type of triangle it is (acute, right, obtuse). TEST CASES: If a user inputs three valid angle values: Enter the first angle in degrees: 60 Enter the second angle in degrees: 30 Enter the third angle in degrees: 90 Result: You have a right triangle! If a user inputs any negative angle values: Enter the first angle in degrees: 45 Enter the second angle in degrees: 55 Enter the third angle in degrees: -80 Result: Error! Please input a positive angle value. If a user inputs values whose sum exceeds 180: Enter the first angle in degrees: 20 Enter the second angle in degrees: 70 Enter the third angle in degrees: 100 Result: Error! It is not a triangle.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT