Question: PLEASE HELP ME WITH THIS PROGRAMMING QUESTION Complete the following unit conversion program with reference to the sample output. Hint: You will need to declare

PLEASE HELP ME WITH THIS PROGRAMMING QUESTION

Complete the following unit conversion program with reference to the sample output.

Hint:

  • You will need to declare some variables in the program. You may use existing variables as reference.
  • Refer to sample output to complete the code.
  • The sample output only shows the expected outcome of the program partially.

#include

int main()

{

char category;

int tempChoice;

int userinputF; // User inputted Fahreinheit;

int userinputUSDtoEuro; // User inputted for USD to EURO;

int userinputOunce; // User inputted for Ounce;

int fahrenheitToCelcius; // variable that stores the converted F->C;

float USDtoEURO ; // variable that stores the converted USD->EURO;

float ounceToPounds; // stores the converted Ounce->Pounds;

printf("Welcome to Unit Converter! ");

scanf("%c",&category); //this code reads in user input from keyboard

if(category == 'T'){

scanf("%d",&tempChoice);

if(tempChoice == 1){

printf("Please enter the Fahrenheit degree: ");

scanf("%d",&userinputF);

fahrenheitToCelcius = ((userinputF-32) * (5.0/9.0));

printf("Celcius: %d",fahrenheitToCelcius);

}

else if(tempChoice == 2){

}

else

printf("Please enter the correct choice. ");

}

else if(category == 'C')

{

// implement your code here

}

else if(category == 'M')

{

// implement your code here

}

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!