Concept explainers
Celsius to Fahrenheit
Write a
F is the Fahrenheit temperature, and C is the Celsius temperature.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Starting Out with Python (4th Edition)
Degarmo's Materials And Processes In Manufacturing
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- Box Office: A movie theater only keeps a percentage (20%) of the revenue earned from ticket sales. The remainder goes to the movie distributor. Write a program that calculates a theater’s gross and net box office profit for a night. The program should ask for the name of the movie, and how many adult and child tickets were sold. (The price of an adult ticket is $10.00 and a child’s ticket is $6.00.) Input: the name of the movie, number of adult tickets sold, number of child tickets sold Output: as specified below Object: cin, cout, getline, format output Note: 1. Movie names contain spaces 2, the report is aligned. 3. The decimal number is displayed with 2 decimal places.arrow_forwardA car’s miles-per-gallon (MPG) can be calculated with the following formula:MPG 5 Miles driven Gallons of gas usedWrite a program that asks the user for the number of miles driven and the gallons of gas used. It should calculate the car’s MPG and display the result.arrow_forwardC++ Celsius to Fahrenheit Write a program that converts user input in Celsius to Fahrenheit temperature. The formula is F=95∗C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. Keep one digit of precision.arrow_forward
- An online book club awards points to its customers based on the number of books purchased each month. Points are awarded as follows: Books Purchased Points Earned 1 5 2 15 3 30 4 or more 60 Write a program that asks the user to enter the number of books purchased this month and then displays the number of points awarded.arrow_forwardThe following table shows the approximate speed of sound in air, water, and steel: Write a program that asks the user to enter “air”, “water”, or “steel” and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take. You can calculate the amount of time it takes sound to travel in air with the following formula: Time = Distance / 1,100 You can calculate the amount of time it takes sound to travel in water with the following formula: Time = Distance / 4,900 You can calculate the amount of time it takes sound to travel in steel with the following formula: Time = Distance / 16,400arrow_forwardC++ please - 24-hour time (also known in the U.S. as military time) is widely used around the world. Time is expressed as hours since midnight. The day starts at 0000, and ends at 2359. Write a program that converts am/pm time to 24-hour time. If the input is 2:30 pm, the output should be 1430. If the input is 12:01 am, the output should be 0001. Hints: Think of how each hour should be handled. 12:00 am -12:59 am becomes what? 8:00 am becomes what? 12:00 pm? 1:00 pm? Group the hours into cases that should be handled similarly (e.g., 1:00 am to 11:00 am are handled the same). Declare variables for hoursAmPm, minAmPm, and hours24. Note that minutes for 24-hour time remain the same as for am/pm, so no extra variable is needed. Use an if-else statement to detect each case, and set the hours24 appropriately. When outputting hour24, check if the hour is 0-9 (just check for < 10). If so, output a "0". So 7 will be output as 07. Do the same when outputting the minutes. #include…arrow_forward
- The island nation of Babbage charges its citizens an income tax each year. The tax rate is based on the following table: Income $0 - 5000 $5001 - 10000 $10001 - 20000 $20001 40000 Over $40000 Tax Rate 0% 3% 5.5% 10.8% 23.7% Write a program that, when given a person's income, prints the tax owed rounded to the nearest dollar. Enter your income: 35000 Your tax is: $3780arrow_forward3. Random Symbol Guessing Game Write a program that generates a random symbol and asks the user to guess what the symbol is. If the user's guess has a higher ASCII number than the random symbol, the program should display "Symbol ASCII too high, try again." If the user's guess has a lower ASCII number than the random symbol, the program should display "Symbol's ASCII too low, try again." The program should use a loop that repeats until the user correctly guesses the random symbol.arrow_forwardScientists measure an object's mass in kilograms and its weight in Newtons. If you know the amount of mass of an object, you can calculate it's weight in Newtons with the following formula: Design a program that asks the user to enter an object's mass, and then calculates its weight. If the object weighs more than 1,000 Newtons, display a message indicating that it is too heavy. If the object weighs less than 10 Newtons, display a message indicating that it is too light. Show in Python and in Flowchart!!!!arrow_forward
- Using c program Use Malaysian ringgitarrow_forwardAverage acceleration is defined as the change of velocitydivided by the time taken to make the change, as given by the following formula: a =v1 - v0 /t Write a program that prompts the user to enter the starting velocity v0 in meters/second, the ending velocity v1 in meters/second, and the time span t in seconds,then displays the average acceleration. Here is a sample run: Enter v0, v1, and t: 5.5 50.9 4.5The average acceleration is 10.0889arrow_forwardThe approximate speed of sound in air, water and steel is: Medium Speed Air 1,100 feet per second Water 4,900 feet per second Steel 16,400 feet per second The time is takes for sound to travel through a medium is computed with the formula: Time = Distance / Speed Write a program that asks the user to enter "A" for air, "W" for water or "S" for steel and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take. You should use a switch statement to select the divisor to use in your formula. Your output should be formatted as seconds to four decimal places. Your program should be properly formatted and commented.arrow_forward
- C++ 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
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage