Google Answers Logo
View Question
 
Q: C Program - Converting a height of a person from feet and inches to centimeters ( No Answer,   0 Comments )
Question  
Subject: C Program - Converting a height of a person from feet and inches to centimeters
Category: Computers > Programming
Asked by: misterpaul7-ga
List Price: $50.00
Posted: 27 Apr 2006 14:44 PDT
Expires: 27 Apr 2006 18:19 PDT
Question ID: 723479
I am trying to write a program that will convert a height of a person
from feet and inches to centimeters. I want to use the relationship: 1
foot = 30.48 cm and 1 inch = 2.54 cm. I am trying to get the output in
a form of a table where the left column would contain the height of
the person in feet and inches from like 4'5" to 6'5" (with an
increment of 1 inch), and the right column will contain the
corresponding height in centimeters. The program will perform a
conversion with the help of a function: void Conversion (int, int);
The function has to be called from the for loop from the function main
(). Since there is no return value, each portion of information will
be printed inside the function.

Any help with this program would be much appreciated. I am new to the
C programming language and I am trying to write a program like this
for my C programming class.

Clarification of Question by misterpaul7-ga on 27 Apr 2006 14:47 PDT
Please help me write this program for my class.

Request for Question Clarification by leapinglizard-ga on 27 Apr 2006 15:25 PDT
Are you asking us to complete an assignment for you? This would be a
violation of house policy. Otherwise, what kind of assistance are you
looking for?

leapinglizard

Request for Question Clarification by leapinglizard-ga on 27 Apr 2006 15:33 PDT
Perhaps I can give you a clue by showing you how the Conversion
function would work. Do you see how to write the main program?

void Conversion(int feet, int inches) {
	int total_inches = 12*feet + inches;
	float total_centimeters = 2.54*total_inches;
	printf("%d\'%d\"   %.0f cm\n", feet, inches, total_centimeters);
}

Please let me know how much more assistance you need for a full answer.

leapinglizard
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy