Write a
Fahrenheit= (9×Celsius) 5+32
Your program should create two integer variables for the temperature in Celsius and Fahrenheit. Initialize the temperature to 100 degrees Celsius. In a loop, decrement the Celsius value and compute the corresponding temperature in Fahrenheit until the two values are the same.
Since you are working with integer values, the formula may not give an exact result for every possible Celsius temperature. This will not affect your solution to this particular problem.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Problem Solving with C++ (9th Edition)
Additional Engineering Textbook Solutions
Starting out with Visual C# (4th Edition)
Programming in C
Java How To Program (Early Objects)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
- Write a program that takes in two integers as input.The output is a countdown starting from the larger integer and stopping when both numbers areidentical.1. Prompt the user for first number 2. Prompt the user for second number. 3. Determine the larger of the two numbers (hint: need conditional statement to compare and determinewhich is larger)4. Utilizing a while loop (for each conditional) print the numbers in descending order 5. Loop stops after printing the smaller numberarrow_forwardWrite a program (lab3.cpp) that finds the temperature that is the same in both Celsius andFahrenheit. The formula to convert from Celsius to Fahrenheit is:??ℎ???ℎ??? = (9 ∗ ???????/5)+32Your program should create two integer variables for the temperature in Celsius and Fahrenheit. Initialize the temperature to 100 degree Celsius. In a loop, decrement the Celsiusvalue and compute the corresponding temperature in Fahrenheit until the two values are the same. An example run of this program is attached as a photo 1. What is the condition that will end the loop?2. Should you check that condition at the beginning or end of the loop?3. What kind of loop is best for that kind of condition checking?arrow_forwardWrite a program that will ask for an integer input from the user, loop terminates until a value zero (0) is entered. At the end, display the highest even number entered. If there are no even numbers found display “no even numbers”arrow_forward
- Write a program that prompts the user to enter theminutes (e.g., 1 billion), and displays the number of years and remaining days forthe minutes. For simplicity, assume that a year has 365 days. Here is a sample run: Enter the number of minutes: 10000000001000000000 minutes is approximately 1902 years and 214 daysarrow_forwardWrite a program containing a pair of nested loops that displays the integer values 1–100, ten numbers per row, with the columns aligned. The first line should print out a title that says something like “Practice 5: Practice with nested loops”. There is no input from the user on this problem. A sample output is below.arrow_forwardWrite a program that output the following using loops. value of x : 19 value of x : 18 value of x : 17 value of x : 16 value of x : 15 value of x : 14 value of x : 13 value of x : 12 value of x : 11 value of x : 10arrow_forward
- Write a program that uses do...while loops to perform the following steps: Prompt the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum). Output all odd numbers between firstNum and secondNum. Output the sum of all even numbers between firstNum and secondNum. Output the numbers and their squares between 1 and 10. Separate the numbers by any amount of spaces. Output the sum of the square of the odd numbers between firstNum and secondNum. Output all uppercase letters.arrow_forwardWrite a program that inputs your student number and printout your Biography when the student numberis correct. Use a Do While / While loop to repeat the process when an incorrect student number is placed.arrow_forwardWrite a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask the user for the number of years. The outer loop will iterate once for each year. The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the number of months, the total inches of rainfall, and the average rainfall per month for the entire period. Add additional loops to validate the input: Do not accept a number less than 1 for the number of years. Continue to prompt the user for a number until a valid number is entered. Do not accept negative numbers for the monthly rainfall. Continue to prompt the user for a number until a valid number is enteredarrow_forward
- ] In a triangle, the sum of the lengths of any two sides is greater than the lengthof the other third side. Write a program triangle.cc that prompts a user to enterthe lengths of three sides, checks if they form a triangle, and outputs if it is an isosceles,equilateral, scalene, or right triangle. Also, your program should output the perimeter andthe area of the triangle. In a right triangle, the square of the length of one side is equalto the sum of the squares of the lengths of the other two sides. An isosceles triangle hastwo sides of equal length. An equilateral triangle has all three sides with the same length.A scalene triangle has no equal sides. Your program should define and use the followingfunctions:(a) isTriangle - takes the 3 sides of a triangle and returns true if they form a triangle,false otherwise.(b) isIsosceles - takes the 3 sides of a triangle and returns true if they form anisosceles triangle, false otherwise.(c) isEquilateral - takes the 3 sides of a triangle and…arrow_forwardWrite a program to generate a table of conversions from Fahrenheit to Kelvin for values from 0 degrees F to 200 degrees F. Allow the user to enter the increment in degrees Fahrenheit between lines. Use a do/while loop in your solution . Kelvin= (°F 32) × 5/9 + 273.15. D Colleges of Appliedarrow_forwardWrite a program that prompts the user to input two integers. Using a while loop, output the multiples of 7 between the two integers.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education