Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

may inplease get help? I am stuck for a while and i want to make sure the direct

ID: 3691472 • Letter: M

Question


may inplease get help? I am stuck for a while and i want to make sure the direction that i code is correct. could you please help me with sample code and comments of explanations? thanks!!

Wrike code to implement the follow three functionalties, where each is ts own function that receives input as needed, and prints out the calculated outcome: . convert from Celsius to Fahrenhet temperatures. 2, convert from pounds and ounces to kiiegrems. 3. convert from inches and feet to kolometers Each function above will not return a value but print out the resut instead To activate that above functions we will use& primitive menu system using the input function, Create the folowing "looking" menu which prints out from the main function: Welcome to the converter system. Choose a conversion rom delow by typing its correspading number 1. Celsus to Fahrenteit 2 Pounds to Kilograms ths numbe lndsatin thcea rgtthtd, then cal he apprpriate Auncten - this happen ins de the mai functian. Make sure each of your three functions 2. Has an argumet list of one rgirment con ents as you see et bimbeg sure to add tap level comments

Explanation / Answer

#include <stdio.h>
void celsius_to_fahrenheit(int *c ,int *f){
   *f = ((*c * 9)/5) + 32;
}
void pounds_to_kilogram(float *p ,float *kg){
   *kg = *p * 0.45359237;
}
void feet_to_kilometer(double *ft ,double *km){
   *km = *ft * 0.0003048;
}
int main(void) {
   // your code goes here
   int c,f;
   float p,kg;
   double ft,km;
   int ch;
   printf("Choose a conversion from below by typing corresponding number: ");
   printf("1.celsius to fahrenheit ");
   printf("2.Pounds to kilogram ");
   printf("3.feet to kilometer ");
   scanf("%d",&ch);
   switch(ch){
       case 1 :printf(" Enter Celisus value:");scanf("%d",&c);celsius_to_fahrenheit(&c,&f);printf(" celisus=%d fahrenheit=%d",c,f); break;
       case 2: printf(" Enter Pounds:");scanf("%f",&p);pounds_to_kilogram(&p,&kg);printf(" Pounds=%.2f Kilogram=%.2f",p,kg); break;
       case 3:printf(" Enter feet:");scanf("%lf",&ft);feet_to_kilometer(&ft,&km);printf(" feet=%lf kilometer=%lf",ft,km); break;
       default:printf("Invalid selection");break;
       }
   return 0;
}

Output: