G
glitter boy
Ok so I have this class for C. I have to write this program for my
instructor, where he has already posted the softcopy and algorithm. But
my question is I have to convert meters to feet and in this I have to
output not only the feet but also the inches now I think I have coded
the feet calculation properly but. I don't know how to send the
remainder to inches and than recalculate it and display that
calculation here is what I have coded this so far.
#include <stdio.h>
#define FACTOR 2.54
int main (void)
{
float HM /*hight in meters*/
float INCHES /*hight in inches (later adjust to just inches of
height)*/
float FEET /*whole feet portion of height*/
/*title and credits*/
printf ("Height Converting Program\n");
printf ("Designed by Randolph Gibson - 15 january 2001\n");
printf ("Coded by Rome Baker - September 2005\n\n");
/*explanation*/
printf ("This program will convert a person?s height from meters\n");
printf ("into feet and inches (rounded to the nearest inch) and \n");
printf ("display the result on the screen. The height must be\n");
printf ("entered in metric units and contain decimal portions.\n");
printf ("The andwer will be displayed in whole feet and inches.\n\n");
/*requesting HM*/
printf ("Enter the person?s height in meters:");
scanf ("%f", &HM);
/*claculate and store numbers*/
INCHES = HM * 100 / FACTOR;
FEET = INCHES / 12;
/*display answers*/
printf ("\nThe height is equivilant to %.0f feet and ")
return (0);
}
and here is the page with my instructors algorithm
http://www.gibson.vero-beach.fl.us/classes/cop2000/fall/prj02.html
sorry i cant explain this better i am just lost right now
instructor, where he has already posted the softcopy and algorithm. But
my question is I have to convert meters to feet and in this I have to
output not only the feet but also the inches now I think I have coded
the feet calculation properly but. I don't know how to send the
remainder to inches and than recalculate it and display that
calculation here is what I have coded this so far.
#include <stdio.h>
#define FACTOR 2.54
int main (void)
{
float HM /*hight in meters*/
float INCHES /*hight in inches (later adjust to just inches of
height)*/
float FEET /*whole feet portion of height*/
/*title and credits*/
printf ("Height Converting Program\n");
printf ("Designed by Randolph Gibson - 15 january 2001\n");
printf ("Coded by Rome Baker - September 2005\n\n");
/*explanation*/
printf ("This program will convert a person?s height from meters\n");
printf ("into feet and inches (rounded to the nearest inch) and \n");
printf ("display the result on the screen. The height must be\n");
printf ("entered in metric units and contain decimal portions.\n");
printf ("The andwer will be displayed in whole feet and inches.\n\n");
/*requesting HM*/
printf ("Enter the person?s height in meters:");
scanf ("%f", &HM);
/*claculate and store numbers*/
INCHES = HM * 100 / FACTOR;
FEET = INCHES / 12;
/*display answers*/
printf ("\nThe height is equivilant to %.0f feet and ")
return (0);
}
and here is the page with my instructors algorithm
http://www.gibson.vero-beach.fl.us/classes/cop2000/fall/prj02.html
sorry i cant explain this better i am just lost right now