hw06 - do-while and switch

Make sure that you follow all the coding standards
From Linux on the GL machine:
  • Write a C program (see below) and save it in a file called menu.c in your ./CMSC104/hw6 directory
  • Compile the program:     
    gcc -o menu menu.c
  • Run the program to make sure it works:     
    ./menu
  • Use the SUBMIT utility turn in the homework.     
    submit cs104_grasso hw06 menu.c menu


Create a program that does the following:

  • Display this menu to the user console

    Choose one option:
    1 - Convert Fahrenheit to Celsius
    2 - Convert kilometers to miles
    3 - Convert knots to miles per hour
    0 - Exit program
  • Use a do-while loop to get the user's choice
    • Read the choice into a char data type using the getchar() function
  • Use a switch statement to process each user request
    • Process each request by simply displaying the name of that function on the console and then return.
    • Ignore white space using the appropriate case constructs
  • After processing, display the menu and process the new requests until the users chooses to exit the program by entering 0