Write a
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.
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Absolute C++
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
C How to Program (8th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Database Concepts (7th Edition)
Starting Out With Visual Basic (7th Edition)
- Write a program that asks the user for a number of integer test scores. It then has the user enter that number of scores and computes the average. Ex: If the input is: 5 95 90 82 88 87 the output is: Your test average is: 88.4 You can assume that the first number is greater than 0. Hint: Use a loop to calculate the sum. When you are done with the loop, calculate the average. pythonarrow_forwardWrite a program that keeps reading integers from the user until he enters zero. The programshould then displays the following: Sum of odd numbers Average of even numbers (use loops)arrow_forwardWrite a program that requests the user to enter the total purchase in dollars and cents ( for example, $23.65, $45.00, etc) and outputs the discount in dollars and cents. If the total purchase is less than 200 dollars, there is no discount. If the total purchase is more than 200 dollars but less than or equal to 1000 dollars, then the discount is 15%, and if the total purchase is more than 1000 dollars, then the discount is 30%. At this store, a student always gets 30% discount on all purchases. Include this information in your codes.arrow_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 that asks the user how many credit units they have taken. If they have taken 23 or less, print that the student is a freshman. If they have taken between 24 and 53, print that they are a sophomore. The range for juniors is 54 to 83, and for seniors it is 84 and over.arrow_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_forward
- Write a program that prompts the user to enter a series of strings, but with each string containing a small integer. Use a while loop and stop the loop when the user enters a zero. When the loop has finished, the program should display: the number of user inputs (not counting the final zero input). the total of the integers in the strings entered. the average of the integers accurate to one decimal place.arrow_forwardWrite 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 that converts Celsius temperatures to Fahrenheit temperatures. The formula isarrow_forward
- Write a program that computes the theoretical flame temperature when a mixture of methane, propane, n-butane, and n-pentane (0% to 100& methane in 5% increments; 0 to 100 mol% propane in 5% increments; 0% to 100% mole n-butane in 5% increments) at 25°C is burned with excess air (0% to 100% excess in 5% increments) preheated to preheated to (50°C to 200°C in 10°C increments)arrow_forwardWrite a program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum USING RAPTORarrow_forwardUse Python to write a program that asks the user to enter a pocket number and displays whether the pocket is green, red, or black. The program should display an error message if the user enters a number that is outside the range of 0 through 56. On a roulette wheel, the pockets are numbered from 0 to 36. The colors of the pockets are as follows: Pocket 0 is green. For pockets 1 through 20, the odd-numbered pockets are red and the even-numbered pockets are black. For pockets 21 through 38, the odd-numbered pockets are black and the even-numbered pockets are red. For pockets 39 through 48, the odd-numbered pockets are red and the even-numbered pockets are black. For pockets 49 through 56, the odd-numbered pockets are black and the even-numbered pockets are red.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