This project is maintained by abrarShariar
View On Github




  Calculator.h

This file containes necessary functions to perform the functionalities of the Phone Calculator



Brief Description:


- Contains necessary functions to handle the features included in the Calculator App .

- functions included in < cmath> is also extensively used .

- PI is declared const .


Functions


double add()


double add(){
    double n1,n2;
    cout<< "\t\tInput[1] : ";
    cin>>n1;
    cout<<"\t\tInput[2] : ";
    cin>>n2;
    return n1+n2;
}
                  

double sub()

 double sub(){
    double n1,n2;
    cout<<"\t\tInput[1] : ";
    cin>>n1;
    cout<<"\t\tInput[2] : ";
    cin>>n2;
    return n1-n2;
}

double mul()

  double mul(){
    double n1,n2;
    cout<<"\t\tInput[1] : ";
    cin>>n1;
    cout<<"\t\tInput[2] : ";
    cin>>n2;
    return n1*n2;
}

double div()

double div(){
    double n1,n2;
    cout<<"\t\tInput[1] : ";
    cin>>n1;
    cout<<"\t\tInput[2] : ";
    cin>>n2;
    if(n2==0){
        throw "Caution: Divided by zero is undefined ";
    }
    return n1/n2;
}