Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 3, Problem 32PS
Program Plan Intro
To create a code that provides an opportunity to the user to input the temperature in form of Centigrade, convert it into Fahrenheit accordingly.
Program Plan:
Create a code that reads the temperature in Centigrade from the user.
The code should convert the temperature to Fahrenheit and display the temperature.
F = 32 + (C*(180.0/100.0))
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Body mass index (BMI) is a measure of health based on weight. It can be calculated by taking your weight in kilograms and dividing it by the square of your height in meters. Write a program that prompts the user to enter a weight in pounds and height in inches and displays the BMI. Note that one pound is 0.45359237 kilograms and one inch is 0.0254 meters.
Body Mass Index is a simple calculation using a person's height and weight.
The formula is BMI = kg/m2 where kg is a person's weight in kilograms and m2 is their height in meters squared.
Calculate a persons Body Mass index using their weight in pounds.
This means you must first convert pounds to kilograms (kg) then apply the formula above.
In converting pounds to kg, 1 pound = 0.453592 kg.
So to convert pounds to kg, either multiply the pound value by 0.45359237 or divide by 2.2046226218.
Then you must convert their height in inches to meters.
The length in meters is equal to the inches multiplied by 0.0254.
Write a program that accepts a users height as an integer in inches and
their weight in pounds.
Convert those inputs to their metric equivalents outlined above and determine their body mass index.
Display what the conversions from and to their metric equivalents are.
Display the body mass index and the category it belongs to.
Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula:
length = v2/2a
Write a program that prompts the user to enter v in meters/second (m/s) and the acceleration a in meters/second squared and displays the minimum runway length.
Chapter 3 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Ch. 3 - A unary expression consists of only one operand...Ch. 3 - The left operand in an assignment expression must...Ch. 3 - Associativity is used to determine which of...Ch. 3 - Side effect is an action that results from the...Ch. 3 - Prob. 5PSCh. 3 - Prob. 6PSCh. 3 - Prob. 7PSCh. 3 - Prob. 8PSCh. 3 - Prob. 9PSCh. 3 - Prob. 10PS
Ch. 3 - Which of the following statements about mixed...Ch. 3 - Which of the following statements about compound...Ch. 3 - Prob. 13PSCh. 3 - Prob. 14PSCh. 3 - Which of the following is not a binary expression?...Ch. 3 - Prob. 16PSCh. 3 - If originally x=4, what is the value of x after...Ch. 3 - Prob. 18PSCh. 3 - Prob. 19PSCh. 3 - What is the value of each of the following...Ch. 3 - Given the following definitions, which of the...Ch. 3 - If originally x=2,y=3,andz=2, what is the value of...Ch. 3 - Prob. 23PSCh. 3 - If x=2945, what is the value of each of the...Ch. 3 - Prob. 25PSCh. 3 - Prob. 26PSCh. 3 - Write a program that reads two integers from the...Ch. 3 - Write a program that extracts and prints the...Ch. 3 - Prob. 29PSCh. 3 - Write a program that calculates the area and...Ch. 3 - Prob. 31PSCh. 3 - Prob. 32PSCh. 3 - Write a program that changes a temperature reading...Ch. 3 - Write the C code for each of the following...Ch. 3 - Prob. 35PSCh. 3 - Write a program that converts and prints a...Ch. 3 - Prob. 37PSCh. 3 - Write a program that prompts a user for an integer...Ch. 3 - Prob. 39PS
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- PLEASE CODE THIS IN VISUAL CODE & MAKE SURE IT RUNSarrow_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_forwardThe volume of any cylinder can be calculated using the following formula: volume = π * radius2 * height Write a program which asks the user to enter the radius and height of a cylinder. If the radius and the height are both greater than 0, calculate the volume of the cylinder and print "value is the volume of the cylinder" where value is the calculated volume of the cylinder. Otherwise, print "The radius and height of a cylinder must both be positive values." Remember to include a comment at the start of the program. (Hint: The value of π is approx. 3.1416)arrow_forward
- Write a Phyton program that computes the duration of a projectile’s flight and its height above the ground when it reaches the target. As part of your solution, you should display instructions to the program user. Relevant formula: time = distancevelocity xcos (θ) height = velocity xsin x time- g x time22 use the following variables: g = gravitational constant = 32.17 = angle of elevation in radian v = velocity or the projectile velocity (ft/sec) d= distance to target t = time of flight in seconds. h = height at impact Try your program on these data sets.arrow_forwardThe date June 10, 1960, is special because when we write it in the following format, the month times the day equals the year: 6/10/60 Write a program that ask the user to enter a month in numeric format, a day and a two-digit year. The program should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is Magic. Otherwise, it should display a message saying the date is not Magic. Output should look as shown below. Create test data and place in a file. Name the code file Last Name + First Initial + "-MagicDates.s", for example "SmithJ- MagicDates.s". Name the test data file in a similar manner. Upload the program and test data files to the Dropbox. 6/10/60 is Magic! 6/10/70 is not Magic. 2/11/22 is Magic!arrow_forwardA county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. If an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then 75¢ for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $45. Write a program that asks for the actual value of a piece of property and displays the assessment value and property tax.arrow_forward
- 3. Draw flowchart to calculate the value of y depending on the given value of x as shown below: if x> 0 y= 3x+2 if X<= 0 y= 3x-2arrow_forwardAirline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönderarrow_forwardWrite a pseudo code for calculating the profit for a company that generates 50% of total sales. Based on that percentage, generate the prediction of the profit for the company sale amount is $7.5million in the current year. Also give three dry runs for the above pseudocode.arrow_forward
- TEST CASE #1: Welcome to 6/15 Lottery Game! Enter a digit up to six times between 0 to 15: Digit 1:3 Digit 2:7 Digit 3:11 Digit 4:9 Digit 5:6 Digit 6:13 Lottery Result: 12|8|12|11|9|9|| Your Chosen number: 3|7|11|9|6|13| Sorry. No Exact Match Found. Try Again! Process exited after 9.399 seconds with return value Press any key to continue TEST CASE #2: Welcome to 6/15 Lottery Game! Enter a digit up to six times between 0 to 15: Digit 1:6 Digit 2:13 Digit 3:7 Digit 4:10 Digit 5:0 Digit 6:4 Lottery Result: 2|2|7|15|1|12|| Your Chosen number: 6|13|7|10|0|4| Match! Your Bet is free for the next draw!arrow_forwardA car holds 15 gallons of gasoline and can travel 375 miles before refueling. Write a program that calculates the number of miles per gallon the car gets. Display the result on the screen. Hint: Use the following formula to calculate miles per gallon (MPG): MPG 5 Miles Driven/Gallons of Gas Used.arrow_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
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY