Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Develop a C program that receives as input a distance value, d, in inches and converts it to yards, feet, and inches (1 yard =
Develop a C program that receives as input a distance value, d, in inches and converts it to yards, feet, and inches (1 yard = 3 feet, 1 foot = 12 inches). Your program should: 1. Read a set of distances from a file called dist.txt 2. Use a function called distConverter to break distance to yards, feet, and inches. 3. Print the conversion result on screen in the main function (not within the distConverter function) The distConverter function prototype should be: void distConverter (int d, int *py, int *pf, int *pi) Sample Output dist.txt file: 130 19 4 12 337 162 0 inches: 130 19 . : yards feet inches 3 1 10 0 1 7 0 0 4 4. : 12 : 0 1 0 337 : 9 1 162 . 4 1 O O P : 0 main.c Load default template... 1 #include 2 void distConverter(int d, int *p_y, int *p_f, int *p_i); 3 4 int main(void){ 5 // add your code here 6 7 return 0; 8 } 9 10 void distConverter(int d, int *p_y, int *p_f, int *p_i){ 11 12 //develop the distance converter function here 13 } 14
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started