i dont know how to do this thanks
NoNobody knows what exactly you want to know when you ask for "this".
Just aother guess:
To call a member function you first have to declare the class
#include <iostream>
class arith {
public:
void tp();
};
using namespace std;
void arith::tp()
{
int z;
do {
cout << endl
<< " 1 -> Addition + \n"
<< " 2 -> Subtraction - \n"
<< " 3 -> Multiplication * \n"
<< " 4 -> Division / \n"
<< " 5 -> Squared x^2 \n"
<< " 6 -> Calculation 1/x \n"
<< " 7 -> Square Root \n"
<< " 8 -> Per Cent \n"
<< " 0 -> Exit \n"
<< " Give a choice: ";
cin >> z;
} while (z != 0);
}
The code was already in main, just copy & paste.
int main()
{
int ep;
arith run;
do {
cout << endl
<< " 1 -> Tupikh Xrhsh \n" << " 2 -> Epistimonikh Xrhsh \n" << " 3 -> Isotimia Nomismatos \n"
<< " 4 -> Thermokrasia \n"
<< " 5 -> Mhkos \n"
<< " 6 -> Varos \n"
<< " 7 -> Xronos \n"
<< " 0 -> Exit \n"
<< " Dwse mia epilogh: ";
cin >> ep;
switch (ep) {
case 1: run.tp();
break;
}
} while (ep != 0);
return 0;
}
Last thing is to call the memberfunction and job is done.