Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I have the following header file and than the accompanying file implementation, I am wondering if anyone can tell me what is wrong with it. The problem that is happening is that it runs withour errors but than it does not allow me to CIN the two numbers. Also do I need a main function? and if so what would it look like, i tried it below but it didn't work
*******************************************
//Formula.h
Class Formula{
private:
int pie, quad;
int AddSub();
public:
Formula(int const a, int const b); // constructor
};
*****************************************
// Formula.cc
int main()
{
return 0;
}
Formula::Formula(int a, int b){
pie = a;
quad = b;
Addsub()
}
void Formula::Addsub(){
cin >> a >> b;
int pieval = pie + quad;
int quadval = pie - quad;
cout << pieval << '/n' << quadval;
}
*********************
*******************************************
//Formula.h
Class Formula{
private:
int pie, quad;
int AddSub();
public:
Formula(int const a, int const b); // constructor
};
*****************************************
// Formula.cc
int main()
{
return 0;
}
Formula::Formula(int a, int b){
pie = a;
quad = b;
Addsub()
}
void Formula::Addsub(){
cin >> a >> b;
int pieval = pie + quad;
int quadval = pie - quad;
cout << pieval << '/n' << quadval;
}
*********************