Simple calculator using functions

The following code represents simple calculator using function. Check out the code below. 


#include "stdafx.h"
#include "iostream"
using namespace std;

float addition(float a, float b){
       float c;
       c = a + b;
       return c;
}
float subtraction(float a, float b){
       float c;
       c = a - b;
       return c;
}
float mutliplication(float a, float b){
       float c;
       c = a * b;
       return c;
}
float division(float a, float b) {
       float c;
       c = a / b;
       return c;
}
float percentage(float a, float b){
       float d;
       d = (a/b) * 100;
       return d;
}
int _tmain(int argc, _TCHAR* argv[])
{
       int option;
       float a, b, c;
       do {
       cout << "Simple calculator using functions" << endl;
       cout << "What would you like to solve" << endl;
       cout << "Select one of the following functions" << endl;
       cout << "1. Addition" << endl;
       cout << "2.Subtraction" << endl;
       cout << "3.Multiplication" << endl;
       cout << "4.Division" << endl;
       cout << "5.Percentage" << endl;
       cin >> option;
             if (option == 1) {
                    cout << "You have selected the addition " << endl;
                    cout << "Please, enter the value of the parameter a: " << endl;
                    cin >> a;
                    cout << "Please, enter the value of the parameter b: " << endl;
                    cin >> b;
                    cout << "The result of a + b is:" << addition(a, b) << endl;
             }
             else if (option == 2) {
                    cout << "You have selected the subtraction: " << endl;
                    cout << "Please, enter the value of the parameter a: " << endl;
                    cin >> a;
                    cout << "Please, enter the value of the parameter b:" << endl;
                    cin >> b;
                    cout << "The result of a -b is:" << subtraction(a,b)<< endl;
             }
             else if (option == 3) {
                    cout << "You have selected the multiplication." << endl;
                    cout << "Please enter the value of the parameter a: " << endl;
                    cin >> a;
                    cout << "Please enter the value of the parameter b: " << endl;
                    cin >> b;
                    cout << "The result of a * b is: " << mutliplication(a, b) << endl;
             }
             else if (option == 4) {
                    cout << "You have selected the division. " << endl;
                    cout << "Please enter the value of the parameter a: " << endl;
                    cin >> a;
                    cout << "Please eneter the value of the parameter b: " << endl;
                    cin >> b;
                    cout << "The result of a/b is: " << division(a,b) << endl;
             }
             else if (option == 5) {
                    cout << "You have selected a percentage." << endl;
                    cout << "Please enter the value of the parameter a: " << endl;
                    cin >> a;
                    cout << "Please enter the value of the parameter b: " << endl;
                    cin >> b;
                    cout << "The result of the (a/b)*100% is: " << percentage(a,b) << "%" << endl;
             }
             else {
                    //Display error message
                    cout << "Invlaid option entered!!!" << endl;
             }
       }
       while (option != 5);
       /*system("pause");*/
       return 0;
}
Share on Google Plus