#include #include #include #include float FtoC (float); float CtoF (float); float sphere (float); float hypotenuse (float,float); void main (void) { char choice; float num; do { system ("cls"); cout << "\n\nWhat do you wish to do -\nConvert from [F]ahrenheit to Celcius\nConvert from [C]elcius to Fahrenheit\nFind the [V]olume of a sphere\nFind the [H]ypotenuse of a Right triangle\n\n --> "; cin >> choice; }while (choice != 'f' && choice != 'c' && choice != 'v' && choice != 'h'); if (choice == 'f') { cout << "\n\nEnter a Fahrenheit temperature --> "; cin >> num; cout << "\n\nCelcius - " << FtoC (num) << endl; } if (choice == 'c') { cout << "\n\nEnter a Celcius temperature --> "; cin >> num; cout << "\n\nFahrenheit - " << CtoF (num) << endl; } if (choice == 'v') { cout << "\n\nEnter the radius of the sphere --> "; cin >> num; cout << "\n\nVolume - " << sphere (num) << endl; } if (choice == 'h') { float num2; cout << "\n\nEnter the 1st side of the triangle --> "; cin >> num; cout << "Enter the 2nd side of the triangle --> "; cin >> num2; cout << "\n\nHypotenuse - " << hypotenuse (num,num2) << endl; } } float FtoC (float a) { return (5.0/9.0) * (a - 32.0); } float CtoF (float a) { return (a / (5.0/9.0)) + 32.0; } float sphere (float a) { return pow(a,3) / (4.0/3.0); } float hypotenuse (float a,float b) { return sqrt(pow(a,2) + pow(b,2)); }