C program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bputley
    New Member
    • Oct 2006
    • 10

    C program

    I am a beginner in C and I I am having a hard time with my first program for school ever in C and need to write a C program called TheConverter that converts from the us customary units of measurement to their counter parts in metric system.

    the user will be allowed to choose from the following

    gallon -> liter
    lb -> kg
    inch -> mm
    Quit the program

    Once the user has selected the unit of measurement they wish to convert they should be prompted to enter the numbeer of units to convert. The program should then convert this amount into appropriate metric unit and display the result using 2 decimal places.

    the user should be allowed to continue with the program until they select the option to quit

    The program should not ask the user if they wish to convert another unit (Y/N).
    Nor should the have to answer any other promptsonce selected the option to quit.

    the program should contain:
    one of the looping control structures to repeat the processuntil they selected the quit option
    A 'switch' statement in the main program that use the selection entered by the user to switch between the different conversions
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by bputley
    I am a beginner in C and I I am having a hard time with my first program for school ever in C and need to write a C program called TheConverter that converts from the us customary units of measurement to their counter parts in metric system.

    the user will be allowed to choose from the following

    gallon -> liter
    lb -> kg
    inch -> mm
    Quit the program

    Once the user has selected the unit of measurement they wish to convert they should be prompted to enter the numbeer of units to convert. The program should then convert this amount into appropriate metric unit and display the result using 2 decimal places.

    the user should be allowed to continue with the program until they select the option to quit

    The program should not ask the user if they wish to convert another unit (Y/N).
    Nor should the have to answer any other promptsonce selected the option to quit.

    the program should contain:
    one of the looping control structures to repeat the processuntil they selected the quit option
    A 'switch' statement in the main program that use the selection entered by the user to switch between the different conversions
    Where is the code that you have been struggling with?

    Comment

    • bputley
      New Member
      • Oct 2006
      • 10

      #3
      Originally posted by r035198x
      Where is the code that you have been struggling with?
      the code how i will make this equal a certain amount when they select it

      Comment

      • tyreld
        New Member
        • Sep 2006
        • 144

        #4
        Nobody is going to write the code for you. You should try and do it yourself, and when you get stuck post the actual code you've written with the specific problems you've encountered.

        Comment

        Working...