I need some ideas...

This is a discussion on I need some ideas... within the C++ Programming forums, part of the General Programming Boards category; Hey all, I'm compiling a rather large calculator based on some (come to think of it, it'd be //most//) of ...

  1. #1
    Unregistered
    Guest

    Question I need some ideas...

    Hey all,

    I'm compiling a rather large calculator based on some (come to think of it, it'd be //most//) of the stuff I've learned in my math class last year. I'm trying to think of anything else I should include in it, but alas, I've gone blank.

    I know that all the differing variables are probably taking up too much memory, and I //do// plan to tone it down to about maybe three variables in the end, but can anyone help me with some ideas? I can't think of anything else to add...

    Here's the code:

    ************************************************** **

    #include <iostream.h>
    #include <math.h>
    #include <stdlib.h>

    void one(void)

    {
    int choice1;
    choice1 = 1, 2, 3, 4, 5, 6, 7;

    float add1, add2, sub1, sub2, mult1, mult2, div1, div2, base, pwr, sq_rt, prcnt1, prcnt2;

    cout<<"Standard Calculations using basic algorithms"<<endl<<endl;
    cout<<"What is the operation you wish to perform?"<<endl<<endl;
    cout<<"1 - Addition"<<endl;
    cout<<"2 - Subtraction"<<endl;
    cout<<"3 - Multiplication"<<endl;
    cout<<"4 - Division"<<endl;
    cout<<"5 - Root & Power configuration"<<endl;
    cout<<"6 - Square roots"<<endl;
    cout<<"7 - Percentages"<<endl<<endl;

    cin>>choice1;

    cout<<"******************************************* *************"<<endl<<endl;

    if (choice1 == 1)
    {
    cout<<"What do you wish to add?"<<endl<<endl;
    cout<<":";
    cin>>add1;
    cout<<"+"<<endl;
    cin>>add2;
    cout<<"="<<endl;
    cout<<add1<<" + "<<add2<<" = "<<add1 + add2<<endl<<endl;
    }

    else if(choice1 == 2)
    {
    cout<<"What do you wish to subtract?"<<endl<<endl;
    cout<<": ";
    cin>>sub1;
    cout<<"-"<<endl;
    cin>>sub2;
    cout<<"="<<endl;
    cout<<sub1<<" - "<<sub2<<" = "<<sub1 - sub2<<endl<<endl;
    }

    else if(choice1 == 3)
    {
    cout<<"What do you wish to multiply?"<<endl<<endl;
    cout<<": ";
    cin>>mult1;
    cout<<"*"<<endl;
    cin>>mult2;
    cout<<"="<<endl;
    cout<<mult1<<" * "<<mult2<<" = "<<mult1 * mult2<<endl<<endl;
    }

    else if(choice1 == 4)
    {
    cout<<"What do you wish to divide?"<<endl<<endl;
    cout<<": ";
    cin>>div1;
    cout<<"/";
    cin>>div2;
    cout<<"=";
    cout<<div1<<" / "<<div2<<" = "<<div1 / div2<<endl<<endl;
    }

    else if(choice1 == 5)
    {
    cout<<"What is the base (root coefficient) of this equation?"<<endl<<endl;
    cin>>base;
    cout<<"What is the power (exponential coefficient) of this equation?"<<endl<<endl;
    cout<<"^"<<endl;
    cin>>pwr;
    cout<<base<<"^"<<pwr<<" = "<<pow(base, pwr)<<endl<<endl;
    }

    else if(choice1 == 6)
    {
    cout<<"What is the number you wish to find the squared-root of?"<<endl<<endl;
    cin>>sq_rt;
    if (sq_rt >= 1)
    {
    cout<<"Output for "<<sq_rt<<" is "<<sqrt(sq_rt)<<endl<<endl;
    }
    else
    {
    cout<<"Error, Bad input. Halting program..."<<endl<<endl;
    }
    }

    else if(choice1 == 7)
    {
    cout<<"What is the standard (upper) coeffieicnt, or the number you"<<endl;
    cout<<"wish to find a certain percentage of?"<<endl<<endl;
    cin>>prcnt1;
    cout<<"What is the subordinate (lower) coefficient, or the"<<endl;
    cout<<"percentile of the previous number you wish to find?"<<endl<<endl;
    cin>>prcnt2;
    cout<<prcnt2<<" percent of "<<prcnt1<<" is "<<(prcnt2/100)*prcnt1<<endl<<endl;
    }

    else
    {
    cout<<"Bad input, halting program"<<endl<<endl;
    }



    }

    void two(void)
    {
    int choice2;

    float side1;
    float side2;
    float base;
    float height;
    float radius;
    float pi;
    pi = 3.1415926535897932384626433832795;

    cout<<"Surface-area calculator"<<endl<<endl;
    cout<<"What do you wish to perform?"<<endl<<endl;
    cout<<"1 - Area Calculator (2-D)"<<endl;
    cout<<"2 - Surface-area Calculator (3-D)"<<endl<<endl;

    cin>>choice2;

    cout<<"******************************************* *************"<<endl<<endl;
    if(choice2 == 1)
    {
    cout<<"Area Calculator for two-dimentional objects"<<endl<<endl;
    //triangle, square, rectangle, circle, paralellogram, trapezoid
    }

    else if(choice2 == 2)
    {
    cout<<"Surface-area Calculator for three-dimentional objects"<<endl<<endl;
    //triangular prism, cube, sphere, rectangular prism, pyramid, cone,
    }

    }

    void three(void)
    {
    int choice3;
    /*Volumetrics*/
    }

    void four(void)
    {
    int choice4;
    choice4 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;

    float sin1, cos1, tan1;
    float asin1, acos1, atan1;
    float log_10, log_n;

    cout<<"Advanced Trigonometrics using advanced algorithms"<<endl<<endl;
    cout<<"What operation do you wish to perform?"<<endl<<endl;
    cout<<"1 - Sine Calculation"<<endl;
    cout<<"2 - Cosine Calculation"<<endl;
    cout<<"3 - Tangent Calculation"<<endl;
    cout<<"4 - Arc-Sine Calculation"<<endl;
    cout<<"5 - Arc-Cosine Calculation"<<endl;
    cout<<"6 - Arc-Tangent Calculation"<<endl;
    cout<<"7 - SINH() Calculation"<<endl;
    cout<<"8 - COSH() Calculation"<<endl;
    cout<<"9 - TANH() Calculation"<<endl;
    cout<<"10 - Base 10 Logarithms"<<endl;
    cout<<"11 - Base e (natural) Logarithms"<<endl;
    cout<<"12 - Section 2 --> Trigonometrics using visual input"<<endl<<endl;

    cin>>choice4;

    cout<<"******************************************* *************"<<endl<<endl;

    if(choice4==1)
    {
    cout<<"What degree do you wish to find the sine of?"<<endl;
    cin>>sin1;
    if (sin1>180 || sin1<0)
    {
    cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
    }
    else
    {
    cout<<"sin("<<sin1<<") = "<<sin(sin1)<<endl<<endl;
    }
    }
    else if(choice4==2)
    {
    cout<<"What degree do you wish to find the cosine of?"<<endl;
    cin>>cos1;
    if (cos1>180 || cos<0)
    {
    cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
    }
    else
    {
    cout<<"cos("<<cos1<<") = "<<cos(cos1)<<endl<<endl;
    }
    }
    else if(choice4==3)
    {
    cout<<"What degree do you wish to find the tangent of?"<<endl;
    cin>>tan1;
    if (tan1>180 || tan1<0)
    {
    cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
    }
    else
    {
    cout<<"tan("<<tan1<<") = "<<tan(tan1)<<endl<<endl;
    }
    }
    else if(choice4==4)
    {
    cout<<"What ratio do you wish to find the arc-sine of?"<<endl;
    cin>>asin1;
    if (asin1>180 || asin1<0)
    {
    cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
    }
    else
    {
    cout<<"asin("<<asin1<<") = "<<asin(asin1)<<endl<<endl;
    }
    }
    else if(choice4==5)
    {
    cout<<"What ratio do you wish to find the arc-cosine of?"<<endl;
    cin>>acos1;
    if (acos1>180 || acos1<0)
    {
    cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
    }
    else
    {
    cout<<"acos("<<acos1<<") = "<<acos(acos1)<<endl<<endl;
    }
    }
    else if(choice4==6)
    {
    cout<<"What ratio do you wish to find the arc-tangent of?"<<endl;
    cin>>atan1;
    if (atan1>180 || atan1<0)
    {
    cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
    }
    else
    {
    cout<<"atan("<<atan1<<") = "<<atan(atan1)<<endl<<endl;
    }
    }
    else if(choice4 == 7)
    {
    //sinh
    }
    else if(choice4 == 8)
    {
    //cosh
    }
    else if(choice4 == 9)
    {
    //tanh
    }
    else if(choice4==10)
    {
    cout<<"What number do you wish to find the base-10 logarithm of?"<<endl;
    cin>>log_10;
    cout<<"log10("<<log_10<<") = "<<log10(log_10)<<endl<<endl;
    }
    else if(choice4==11)
    {
    cout<<"What number do you wish to find the natural logarithm of?"<<endl;
    cin>>log_n;
    cout<<"log("<<log_n<<") = "<<log(log_n)<<endl<<endl;
    }


    else if(choice4==12)
    {
    int trig_s2;
    trig_s2 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11;
    cout<<"******************************************* *************"<<endl;
    cout<<"Trigonometrics section 2 --> Trigonometrics using visual input"<<endl<<endl;

    cout<<"What operation do you wish to perform?"<<endl<<endl;

    cout<<"1 - Find the sine of a triangle when given two sides"<<endl;
    cout<<"2 - Find the sine of a triangle when given one side and one angle"<<endl;
    cout<<"3 - Find the cosine of a triangle when given two sides"<<endl;
    cout<<"4 - Find the cosine of a triangle when given one side and one angle"<<endl;
    cout<<"5 - Find the tangent of a triangle when given two sides"<<endl;
    cout<<"6 - Find the tangent of a triangle when given one side and one angle"<<endl;
    cout<<"7 - Find the angle of a triangle when given two sides that equal sine"<<endl;
    cout<<"8 - Find the angle of a triangle when given two sides that equal cosine"<<endl;
    cout<<"9 - Find the angle of a triangle when given two sides that equal tangent"<<endl;
    cout<<"10 - Find the hypotenuse when given two sides"<<endl;
    cout<<"11 - Find the missing side when given (a^2) |or| (b^2) and c^2"<<endl;
    cin>>trig_s2;
    cout<<"******************************************* *************"<<endl<<endl;

    if(trig_s2==1)
    {
    /* 2sidesine */
    }
    else if(trig_s2==2)
    {
    /* 1sidesine */
    }
    else if(trig_s2==3)
    {
    /* 2sidecosine */
    }
    else if(trig_s2==4)
    {
    /* 1sidecosine */
    }
    else if(trig_s2==5)
    {
    /* 2sidetangent */
    }
    else if(trig_s2==6)
    {
    /* 1sidetangent */
    }
    else if(trig_s2==7)
    {
    /* angle_sine */
    }
    else if(trig_s2==8)
    {
    /* angle_cosine */
    }
    else if(trig_s2==9)
    {
    /* angle_tangent */
    }
    else if(trig_s2==10)
    {
    /* 2sidehypotenuse */
    }
    else if(trig_s2==11)
    {
    /* missingside */
    }
    }
    else
    {
    cout<<"Bad input, halting program";
    }
    }

    void five(void)
    {
    /*Advanced algorithms & calculus --> LEAVE UNTIL THE END!!!*/
    cout<<"******************************************* *************"<<endl<<endl;
    }

    void six(void)
    {
    //Unit conversion --> SI prefixes first!!!
    cout<<"******************************************* *************"<<endl<<endl;
    }

    int main(int argc, char *argv[])
    {

    int choice_main;
    choice_main = 1,2,3,4,5,6,7;

    cout<<"******************************************* *************"<<endl;
    cout<<"Welcome to the Advanced Mathematics Calculator"<<endl;
    cout<<"Programmed by Dead Cell"<<endl;
    cout<<"dead_cell@hackermail.com"<<endl;
    cout<<"******************************************* *************"<<endl<<endl;
    cout<<"Which function of the calculator do you wish to utilize?"<<endl<<endl;
    cout<<"1 - Standard Calculations using basic algorithms"<<endl;
    cout<<"2 - Advanced Surface-area calculating using advanced algorithms"<<endl;
    cout<<"3 - Advanced Volume calculations based on advanced algorithms"<<endl;
    cout<<"4 - Advanced Trigonometrics using advanced algorithms"<<endl;
    cout<<"5 - Advanced use of scientific algorithms and mathematical observations"<<endl;
    cout<<"6 - Standard unit conversion"<<endl;
    cout<<"7 - Exit"<<endl<<endl;
    cout<<":";
    cin>>choice_main;
    cout<<"******************************************* *************"<<endl<<endl;
    switch(choice_main)
    {
    case 1 : one();
    break;
    case 2 : two();
    break;
    case 3 : three();
    break;
    case 4 : four();
    break;
    case 5 : five();
    break;
    case 6 : six();
    break;
    case 7 :
    return 0;
    default:
    cout<<"Error, bad input, halting program"<<endl<<endl;
    }
    system("PAUSE");
    return 0;
    }

    ************************************************** **

    I'm not asking anyone to finish the code - that's my job - but I'm just asking for some ideas I can use... Any input is very much welcome.

    ~Dead Cell

  2. #2
    Unregistered
    Guest

    eek, sorry 'bout the code insertion operators

    I'm still pretty new to this board - I forgot about the code insertion operators... here's the code again, hopefully it'll come out right...

    Code:
    #include <iostream.h>
    #include <math.h>
    #include <stdlib.h>
    /*
       Name:            Advanced Math Calculator v.2, Beta 1
       Description:     Advanced Mathematics calculator using advanced and standardized algorithms
       Date:            June 18, 2002 - June ...?
    */
    
    void one(void)
    
                {
                int choice1;
                choice1 = 1, 2, 3, 4, 5, 6, 7;
    
                float add1, add2, sub1, sub2, mult1, mult2, div1, div2, base, pwr, sq_rt, prcnt1, prcnt2;
    
                cout<<"Standard Calculations using basic algorithms"<<endl<<endl;
                cout<<"What is the operation you wish to perform?"<<endl<<endl;
                cout<<"1 - Addition"<<endl;
                cout<<"2 - Subtraction"<<endl;
                cout<<"3 - Multiplication"<<endl;
                cout<<"4 - Division"<<endl;
                cout<<"5 - Root & Power configuration"<<endl;
                cout<<"6 - Square roots"<<endl;
                cout<<"7 - Percentages"<<endl<<endl;
    
                cin>>choice1;
    
                cout<<"********************************************************"<<endl<<endl;
    
                if (choice1 == 1)
                {
                cout<<"What do you wish to add?"<<endl<<endl;
                cout<<":";
                cin>>add1;
                cout<<"+"<<endl;
                cin>>add2;
                cout<<"="<<endl;
                cout<<add1<<" + "<<add2<<" = "<<add1 + add2<<endl<<endl;
                }
    
                else if(choice1 == 2)
                {
                cout<<"What do you wish to subtract?"<<endl<<endl;
                cout<<": ";
                cin>>sub1;
                cout<<"-"<<endl;
                cin>>sub2;
                cout<<"="<<endl;
                cout<<sub1<<" - "<<sub2<<" = "<<sub1 - sub2<<endl<<endl;
                }
    
                else if(choice1 == 3)
                {
                cout<<"What do you wish to multiply?"<<endl<<endl;
                cout<<": ";
                cin>>mult1;
                cout<<"*"<<endl;
                cin>>mult2;
                cout<<"="<<endl;
                cout<<mult1<<" * "<<mult2<<" = "<<mult1 * mult2<<endl<<endl;
                }
    
                else if(choice1 == 4)
                {
                cout<<"What do you wish to divide?"<<endl<<endl;
                cout<<": ";
                cin>>div1;
                cout<<"/";
                cin>>div2;
                cout<<"=";
                cout<<div1<<" / "<<div2<<" = "<<div1 / div2<<endl<<endl;
                }
    
                else if(choice1 == 5)
                {
                cout<<"What is the base (root coefficient) of this equation?"<<endl<<endl;
                cin>>base;
                cout<<"What is the power (exponential coefficient) of this equation?"<<endl<<endl;
                cout<<"^"<<endl;
                cin>>pwr;
                cout<<base<<"^"<<pwr<<" = "<<pow(base, pwr)<<endl<<endl;
                }
    
                else if(choice1 == 6)
                {
                cout<<"What is the number you wish to find the squared-root of?"<<endl<<endl;
                cin>>sq_rt;
                    if (sq_rt >= 1)
                    {
                    cout<<"Output for "<<sq_rt<<" is "<<sqrt(sq_rt)<<endl<<endl;
                    }
                    else
                    {
                    cout<<"Error, Bad input.  Halting program..."<<endl<<endl;
                    }
                }
    
                else if(choice1 == 7)
                {                  
                cout<<"What is the standard (upper) coeffieicnt, or the number you"<<endl;
                cout<<"wish to find a certain percentage of?"<<endl<<endl;
                cin>>prcnt1;
                cout<<"What is the subordinate (lower) coefficient, or the"<<endl;
                cout<<"percentile of the previous number you wish to find?"<<endl<<endl;
                cin>>prcnt2;
                cout<<prcnt2<<" percent of "<<prcnt1<<" is "<<(prcnt2/100)*prcnt1<<endl<<endl;
                }
    
                else
                {
                cout<<"Bad input, halting program"<<endl<<endl;
                }
    
    
    
    }
    
    void two(void)
    {
    int choice2;
    
    float side1;
    float side2;
    float base;
    float height;
    float radius;
    float pi;
    pi = 3.1415926535897932384626433832795;
    
    cout<<"Surface-area calculator"<<endl<<endl;
    cout<<"What do you wish to perform?"<<endl<<endl;
    cout<<"1 - Area Calculator (2-D)"<<endl;
    cout<<"2 - Surface-area Calculator (3-D)"<<endl<<endl;
    
    cin>>choice2;
    
    cout<<"********************************************************"<<endl<<endl;
    if(choice2 == 1)
    {
    cout<<"Area Calculator for two-dimentional objects"<<endl<<endl;
    //triangle, square, rectangle, circle, paralellogram, trapezoid
    }
    
    else if(choice2 == 2)
    {
    cout<<"Surface-area Calculator for three-dimentional objects"<<endl<<endl;
    //triangular prism, cube, sphere, rectangular prism, pyramid, cone,
    }
    
    }
    
    void three(void)
    {
    int choice3;
    /*Volumetrics*/
    }
    
    void four(void)
    {
    int choice4;
    choice4 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;
    
    float sin1, cos1, tan1;
    float asin1, acos1, atan1;
    float log_10, log_n;
    
    cout<<"Advanced Trigonometrics using advanced algorithms"<<endl<<endl;
    cout<<"What operation do you wish to perform?"<<endl<<endl;
    cout<<"1 - Sine Calculation"<<endl;
    cout<<"2 - Cosine Calculation"<<endl;
    cout<<"3 - Tangent Calculation"<<endl;
    cout<<"4 - Arc-Sine Calculation"<<endl;
    cout<<"5 - Arc-Cosine Calculation"<<endl;
    cout<<"6 - Arc-Tangent Calculation"<<endl;
    cout<<"7 - SINH() Calculation"<<endl;
    cout<<"8 - COSH() Calculation"<<endl;
    cout<<"9 - TANH() Calculation"<<endl;
    cout<<"10 - Base 10 Logarithms"<<endl;
    cout<<"11 - Base e (natural) Logarithms"<<endl;
    cout<<"12 - Section 2 --> Trigonometrics using visual input"<<endl<<endl;
    
    cin>>choice4;
    
    cout<<"********************************************************"<<endl<<endl;
    
    if(choice4==1)
    {
    cout<<"What degree do you wish to find the sine of?"<<endl;
    cin>>sin1;
               if (sin1>180 || sin1<0)
               {
               cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
               }
               else
               {
               cout<<"sin("<<sin1<<") = "<<sin(sin1)<<endl<<endl;
               }
    }
    else if(choice4==2)
    {
    cout<<"What degree do you wish to find the cosine of?"<<endl;
    cin>>cos1;
               if (cos1>180 || cos<0)
               {
               cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
               }
               else
               {
               cout<<"cos("<<cos1<<") = "<<cos(cos1)<<endl<<endl;
               }
    }
    else if(choice4==3)
    {
    cout<<"What degree do you wish to find the tangent of?"<<endl;
    cin>>tan1;
               if (tan1>180 || tan1<0)
               {
               cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
               }
               else
               {
               cout<<"tan("<<tan1<<") = "<<tan(tan1)<<endl<<endl;
               }
    }
    else if(choice4==4)
    {
    cout<<"What ratio do you wish to find the arc-sine of?"<<endl;
    cin>>asin1;
               if (asin1>180 || asin1<0)
               {
               cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
               }
               else
               {
               cout<<"asin("<<asin1<<") = "<<asin(asin1)<<endl<<endl;
               }
    }
    else if(choice4==5)
    {
    cout<<"What ratio do you wish to find the arc-cosine of?"<<endl;
    cin>>acos1;
               if (acos1>180 || acos1<0)
               {
               cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
               }
               else
               {
               cout<<"acos("<<acos1<<") = "<<acos(acos1)<<endl<<endl;
               }
    }
    else if(choice4==6)
    {
    cout<<"What ratio do you wish to find the arc-tangent of?"<<endl;
    cin>>atan1;
               if (atan1>180 || atan1<0)
               {
               cout<<"The degree must be between 0 and 180 degrees"<<endl<<endl;
               }
               else
               {
               cout<<"atan("<<atan1<<") = "<<atan(atan1)<<endl<<endl;
               }
    }
    else if(choice4 == 7)
    {
    //sinh
    }
    else if(choice4 == 8)
    {
    //cosh
    }
    else if(choice4 == 9)
    {
    //tanh
    }
    else if(choice4==10)
    {
    cout<<"What number do you wish to find the base-10 logarithm of?"<<endl;
    cin>>log_10;
    cout<<"log10("<<log_10<<") = "<<log10(log_10)<<endl<<endl;
    }
    else if(choice4==11)
    {
    cout<<"What number do you wish to find the natural logarithm of?"<<endl;
    cin>>log_n;
    cout<<"log("<<log_n<<") = "<<log(log_n)<<endl<<endl;
    }
    
    
         else if(choice4==12)
              {
               int trig_s2;
               trig_s2 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11;
               cout<<"********************************************************"<<endl;
               cout<<"Trigonometrics section 2 --> Trigonometrics using visual input"<<endl<<endl;
    
               cout<<"What operation do you wish to perform?"<<endl<<endl;
    
               cout<<"1 - Find the sine of a triangle when given two sides"<<endl;
               cout<<"2 - Find the sine of a triangle when given one side and one angle"<<endl;
               cout<<"3 - Find the cosine of a triangle when given two sides"<<endl;
               cout<<"4 - Find the cosine of a triangle when given one side and one angle"<<endl;
               cout<<"5 - Find the tangent of a triangle when given two sides"<<endl;
               cout<<"6 - Find the tangent of a triangle when given one side and one angle"<<endl;
               cout<<"7 - Find the angle of a triangle when given two sides that equal sine"<<endl;
               cout<<"8 - Find the angle of a triangle when given two sides that equal cosine"<<endl;
               cout<<"9 - Find the angle of a triangle when given two sides that equal tangent"<<endl;
               cout<<"10 - Find the hypotenuse when given two sides"<<endl;
               cout<<"11 - Find the missing side when given (a^2) |or| (b^2) and c^2"<<endl;
               cin>>trig_s2;
               cout<<"********************************************************"<<endl<<endl;
    
                            if(trig_s2==1)
                            {
                            /* 2sidesine */
                            }
                            else if(trig_s2==2)
                            {
                            /* 1sidesine */
                            }
                            else if(trig_s2==3)
                            {
                            /* 2sidecosine */
                            }
                            else if(trig_s2==4)
                            {
                            /* 1sidecosine */
                            }
                            else if(trig_s2==5)
                            {
                            /* 2sidetangent */
                            }
                            else if(trig_s2==6)
                            {
                            /* 1sidetangent */
                            }
                            else if(trig_s2==7)
                            {
                            /* angle_sine */
                            }
                            else if(trig_s2==8)
                            {
                            /* angle_cosine */
                            }
                            else if(trig_s2==9)
                            {
                            /* angle_tangent */
                            }
                            else if(trig_s2==10)
                            {
                            /* 2sidehypotenuse */
                            }
                            else if(trig_s2==11)
                            {
                            /* missingside */
                            }
                }
                else
                {
                cout<<"Bad input, halting program";
                }
    }
    
    void five(void)
    {
    /*Advanced algorithms & calculus --> LEAVE UNTIL THE END!!!*/
    cout<<"********************************************************"<<endl<<endl;
    }
    
    void six(void)
    {
    //Unit conversion --> SI prefixes first!!!
    cout<<"********************************************************"<<endl<<endl;
    }
    
    int main(int argc, char *argv[])
    {
    
    int choice_main;
    choice_main = 1,2,3,4,5,6,7;
    
    cout<<"********************************************************"<<endl;
    cout<<"Welcome to the Advanced Mathematics Calculator"<<endl;
    cout<<"Programmed by Dead Cell"<<endl;
    cout<<"dead_cell@hackermail.com"<<endl;
    cout<<"********************************************************"<<endl<<endl;
    cout<<"Which function of the calculator do you wish to utilize?"<<endl<<endl;
    cout<<"1 - Standard Calculations using basic algorithms"<<endl;
    cout<<"2 - Advanced Surface-area calculating using advanced algorithms"<<endl;
    cout<<"3 - Advanced Volume calculations based on advanced algorithms"<<endl;
    cout<<"4 - Advanced Trigonometrics using advanced algorithms"<<endl;
    cout<<"5 - Advanced use of scientific algorithms and mathematical observations"<<endl;
    cout<<"6 - Standard unit conversion"<<endl;
    cout<<"7 - Exit"<<endl<<endl;
    cout<<":";
    cin>>choice_main;
    cout<<"********************************************************"<<endl<<endl;
    switch(choice_main)
    {
    case 1 : one();
    break;
    case 2 : two();
    break;
    case 3 : three();
    break;
    case 4 : four();
    break;
    case 5 : five();
    break;
    case 6 : six();
    break;
    case 7 :
    return 0;
    default:
    cout<<"Error, bad input, halting program"<<endl<<endl;
    }
    system("PAUSE");
    return 0;
    }
    PS: Sorry 'bout that...

  3. #3
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Well, you can do exponents, fraction conversions (break down the fractions to smaller fractions), linear equations, and slew of other stuff like square root conversions (same as fraction conversions, but with square roots)

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    87
    Why do you use the switch statement only once???
    PuterPaul.co.uk - Portfolio site

  5. #5
    Registered User dead_cell's Avatar
    Join Date
    Jun 2002
    Posts
    44

    Thumbs up

    it hadn't hit me to use the switch statement more than once... Thanks, I'll get on it ASAP!
    Linux is great - It does infinite loops in five seconds!

    ~Linus Torvalds

  6. #6
    Banned borko_b's Avatar
    Join Date
    Jun 2002
    Location
    Well... I live in Bulgaria :)
    Posts
    100
    damn!
    this is like a novell!!!

  7. #7
    Registered User dead_cell's Avatar
    Join Date
    Jun 2002
    Posts
    44
    Okay, I tried the muliple case statements, but I keep getting an error that states the case value '1' is not allowed, or something to that effect.

    Oh, and sorry 'bout the length of it... I needed to shorten it up anyway... :cool:
    Linux is great - It does infinite loops in five seconds!

    ~Linus Torvalds

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ideas, how do you get them? xD
    By Akkernight in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 01-22-2009, 02:53 AM
  2. cool ideas for a game
    By Shadow12345 in forum Game Programming
    Replies: 7
    Last Post: 05-18-2004, 08:37 PM
  3. Company Name Ideas
    By brunomiranda in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 12-16-2003, 04:15 PM
  4. idea's idea's idea's
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 04-29-2002, 12:30 AM
  5. Small app ideas
    By dirkduck in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 02-15-2002, 07:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21