Menu ▾ ▴

Help Needed- Cant get the conversion to work.

Debugging
2015-10-14
2015-10-14
  • Dominic McGrath

    Dominic McGrath - 2015-10-14

    include "iostream"

    include <windows.h></windows.h>

    using namespace std;

    int main()
    {
    int option;

    cout << "Welcome to the converter\n";
    cout << "Please select function you would like to convert;\n";
    cout << "1 - Degrees Fahrenheit to Celsius;\n";
    cout << "2 - Inches to centimeters;\n";
    cout << "3 - Pound to Stones.\n";
    cout << "Please enter the digit here : ";
    
    cin >> option;
    
    switch(digit);
        {
            case '1' :
                cout << "Please enter your Fahrenheit degrees here : ";
                cin >> number;
                answer = (number - 1) * .5556;
                cout << "Fahrenheit converted to Celsius : " << answer;
                break;
    
            case '2' :
                cout << "Please enter the amount of inches here : ";
                cin >> number;
                answer = number * 2.54;
                cout << "Inches converted to centimeters : " << answer;
                break;
    
            case '3' :
                cout << "Please enter the amount of pounds here : ";
                cin >> number;
                answer = number * 14;
                cout << "Pounds converted to stones : " << answer;
                break;
        }
    return 0;
    

    }

     

Log in to post a comment.