How would you write this into pseudo code

#include<cstdio>
#include<cstdlib>
#include<iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])

    //variables
    string var, var1;
    float cm, mile, kilometer, inch, meter, AU, fahrenheit, celsius, foot, quit, i;
    //program
    i = 1;
    while (i <= 1000000000) 
        cout << "Enter the starting unit. For a list of all units and commands, type list. To exit, type quit. Please note that this program will only loop one billion times." << endl <<endl;
        cin >> var;
        cout << endl;

            if (var == "quit")

                    return 0;

            //list of functions
            if  (var == "list")

                cout << "For cm to inch type centimeter. For inch to cm type inch. For miles to km type mile. For km to miles type kilometer. For meters to AU or feet type meter. For AU to meters type AU. For feet to meters type feet. For fahrenheit to celsius type fahrenheit. For Celsius to Fahrenheit type celsius then rerun the program." << endl << endl << endl;

            //inches to centimeters
            if  (var == "inch")

                cout << "Please enter the number of inches" << endl;
               cin >> inch;
                cm = inch * 2.54;
                cout << "Distance in centimeters:" << endl;
                cout << cm << endl;

            //centimeters to inches
            if  (var == "centimeter")

                cout << "Please enter the number of centimeters" << endl;
                cin >> cm;
                inch = cm / 2.54;
                cout << "Distance in inches:" << endl;
                cout << inch << endl;

            //miles to kilometers
            if  (var == "mile")

                cout << "Please enter the number of miles" << endl;
               cin >> mile;
                kilometer = mile * 1.609344;
                cout << "Distance in kilometers:" << endl;
                cout << kilometer << endl;

            //kilometers to miles
            if  (var == "kilometer")

                cout << "Please enter the number of kilometers" << endl;
                cin >> kilometer;
                mile = kilometer / 1.609344;
                cout << "Distance in miles:" << endl;
                cout << mile << endl;

            //meters to AU or feet
            if  (var == "meter")

                cout << "Please select which unit you would like to convert meters to out of Astronomical units and feet" << endl;
                cin >> var1;
                //AU
                if  (var1 == "AU");

                    cout << "Please enter number of meters" << endl;
                   cin >> meter;
                    AU = meter / 149598000000;
                    cout << "Distance in AU:" << endl;
                    cout << AU << endl;

                //feet
                if  (var1 == "feet")

                    cout << "Please enter number of meters" << endl;
                    cin >> meter;
                    foot = meter * 3.2808399;
                    cout << "Distance in feet:" << endl;
                    cout << foot << endl;

            //AU to meters
            if  (var == "AU")

                cout << "Please enter number of AU" << endl;
                cin >> AU;
                meter = AU * 149598000000;
                cout << "Distance in meters:" << endl;
                cout << meter << endl;

            //feet to meters
            if  (var == "feet")

                cout << "Please enter number of feet" << endl;
                cin >> foot;
                meter = foot / 3.2808399;
                cout << "Distance in meters:" << endl;
                cout << meter << endl;

            //fahrenheit to celsius
            if  (var == "fahrenheit")

                cout << "Please enter temperature in Fahrenheit." << endl;
                cin >> fahrenheit;
                celsius = (fahrenheit - 32) * (5 / 9);
                cout << "Temperature in celsius:" << endl;
                cout << celsius << endl;

            //celsius to fahrenheit
            if  (var == "celsius")

                cout << "Please enter temperature in Celsius." << endl;
                cin >> celsius;
                fahrenheit = (celsius * (9 / 5)) + 32;
                cout << "Temperature in Fahrenheit:" << endl;
                cout << fahrenheit << endl;

        i++;

    system("PAUSE");

Maybe it's one line?

Input value and units used such as 0C and print out the conversion is similar units such as Kelvin and Fahrenheit. Add support for other weights and meassures.

I wouldn't. I'd write the pseudo-code first, then make it into comments, then write the code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.