Please someone help-One more question
I am new to programming and am in a class in college. I have written this program to convert to the provided units. My output data is all screwed up and I have no idea why. This is due tomorrow so any help is greatly appreciated.
Code:
// Name: John King
// Date: Monday February 15 at 8:oo AM
// Desc: The purpose of this project is to modularize our Project One. Also to $
// conversions in for Kelvi and inches.
#include <stdio.h>
//Prototypes
void getInput(int* pFahrenheit, int* pFeet, int* pPounds);
int calc(int fahrenheit, int feet, int pounds);
float calcTemp(int fahrenheit);
float calcDistance(int feet);
float calcWeight(int pounds);
void display (int fahrenheit, int celsius, int kelvin, int feet, int meters, in$
int pounds, int kilograms);
//calls all the other functions
int main(void)
{
int fahrenheit, feet, pounds;
int celsius, kelvin, meters, inches, kilograms;
getInput(&fahrenheit, &feet, £s);
calc(fahrenheit, feet, pounds);
display(fahrenheit, celsius, kelvin, feet, meters, inches, pounds, kilograms$
return 0;
}
void getInput(int* pFahrenheit, int* pFeet, int* pPounds)
{
printf("\nName: John King");
printf("\nPlease enter an integer value for Fahrenheit:");
scanf("%d", pFahrenheit);
printf("\nPlease enter an integer value for Feet:");
scanf("%d", pFeet);
printf("\nPlease enter an integer value for Pounds:");
scanf("%d", pPounds);
}
int calc(int fahrenheit, int feet, int pounds)
{
calcTemp(fahrenheit);
calcDistance(feet);
calcWeight(pounds);
}
float calcTemp(int fahrenheit)
{
float celsius, kelvin;
celsius = (fahrenheit - 32) / 1.8;
kelvin = celsius + 273.15;
}
float calcDistance(int feet)
{
float meters, inches;
meters = feet / 3.2808399;
inches= feet * 12;
}
float calcWeight(int pounds)
{
float kilograms;
kilograms = pounds / 2.20462262;
}
void display(int fahrenheit, int celsius, int kelvin, int feet, int meters, int$
int pounds, int kilograms)
{
printf("\n%20s%20s%20s%20s%20s%20s", "Original", "Value", "Converted To",
"Value", "Converted To", "Value");
printf("\n%20s%20s%20s%20s%20s%20s", "--------", "-----", "------------", "-$
"------------", "-----");
printf("\n%20s%20d%20s%20.3d%20s%20.3d", "Fahrenheit", fahrenheit, "Celsius"$
"Kelvin", kelvin);
printf("\n%20s%20d%20s%20.3d%20s%20.3d", "Feet", feet, "Meters", meters, "In$
printf("\n%20s%20d%20s%20.3d", "Pounds", pounds, "Kilograms", kilograms);
printf("\n\n");
}