-2
I typed this program from the book that addresses classes and gave error. How to solve?
#include <iostream>
using namespace std;
class Efetua_calculo{
private:
double total;
double soma;
double divide;
public:
void mostra_calculo (void){
cout << "Resultado das funcoes soma() e divide() e :" << endl;
cout << soma() << endl;
cout << divide() << endl;
return;
}
};
double Efetua_calculo::soma(){
int valor1 = 2;
int valor2 = 3;
total = valor1 + valor2;
return (total);
}
double Efetua_calculo::divide(){
int valor1 = 2;
int valor2 = 3;
total = (double) valor1/valor2;
return(total);
}
int main()
{
Efetua_calculo calculo;
calulo.mostra_calculo();
return 0;
}
What error was returned? Give us more details @Rodolfo
– Jéf Bueno
Edit your question and put the error exit there. It is easier to help you if we know what is happening.
– Jéf Bueno
take a look at the issue.
– Vale
-1 for the bad title and for using a "photo" to present the problem, when (which makes it difficult for people with the same problem to find this question)
– Guilherme Nascimento
People need to stop voting robotically and analyze the problem. It’s not just typo you have there.
– Maniero