Computer Science: A Structured Programming Approach Using C, Third Edition
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.
bartleby

Videos

Question
Book Icon
Chapter 4, Problem 33PS
Program Plan Intro

To write the code that provides an opportunity to the user to enter the measurement in inches and convert it into centimetres.

Program Plan:

Write a program in C that contains a user-defined function, which is used to convert the measurement entered by the user in inches to centimetres.

Following are the steps that used to implement the program.

Define a user-defined function named InchestoCentimeters.

In the main method, declare a variable for reading the value entered by the user.

Make a call to the user-defined method by passing the value as an argument.

Multiply the value entered by the user by 2.54 to convert it into centimetres.

Show the result as the output.

Blurred answer
Students have asked these similar questions
The following formula gives the distance between two points, (x1, yl) and (x2, y2) in the Cartesian plane: V(x2 – x1)2 + (y2 – y)²
Airline 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önder
python Write a program that does temperature converter", "- The user will enter if he wants the result in Celsius or in Fahrenheit. Use the input function to read this option. \n", "- Ask the user the value of the temperature he wants to convert. Use the input function to read this value and convert accordingly.\n", "- If the user wants the temperature in Fahrenheit compute: $ Fahrenheit = Celsius5/9+32$.\n", "- If the user wants the Celsius compute as follows: $ C = (F-32)5/9 $.\n", "\n", "Print the converted temperature and show the unit, like 23.5 C or 67.1 F."

Chapter 4 Solutions

Computer Science: A Structured Programming Approach Using C, Third Edition

Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Computer Programming for Beginners | Functions, Parameters & Arguments | Ep24; Author: Programming With Avelx;https://www.youtube.com/watch?v=VXlh-qJpfw0;License: Standard YouTube License, CC-BY