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
Using functions, create a program that reads three integer values, and then determines whether they can be the sides of a triangle.(the numbers. Notes: The values can represent the sides of a triangle if the sum of any two sides of the triangle is greater than the third side
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

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++ 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