#include <iostream>
using namespace std;
class Efetua_calculo {
private:
double total;
public:
void mostra_calculo(); //aqui só cabe a declaração e não a definição
double soma(); //declarei essa função que não estava declarada
double divide(); //idem, estava declarada como variável
};
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);
}
void Efetua_calculo::mostra_calculo(){ //trouxe a implementação p/ cá
cout << "Resultado das funcoes soma() e divide() e :" << endl;
cout << soma() << endl;
cout << divide() << endl;
return;
}
int main() {
Efetua_calculo calculo;
calculo.mostra_calculo(); //tinha erro de digitação aqui
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgRWZldHVhX2NhbGN1bG8gewpwcml2YXRlOgogICAgZG91YmxlIHRvdGFsOwpwdWJsaWM6CiAgICB2b2lkIG1vc3RyYV9jYWxjdWxvKCk7IC8vYXF1aSBzw7MgY2FiZSBhIGRlY2xhcmHDp8OjbyBlIG7Do28gYSBkZWZpbmnDp8OjbwogICAgZG91YmxlIHNvbWEoKTsgLy9kZWNsYXJlaSBlc3NhIGZ1bsOnw6NvIHF1ZSBuw6NvIGVzdGF2YSBkZWNsYXJhZGEKICAgIGRvdWJsZSBkaXZpZGUoKTsgLy9pZGVtLCBlc3RhdmEgZGVjbGFyYWRhIGNvbW8gdmFyacOhdmVsCn07CmRvdWJsZSBFZmV0dWFfY2FsY3Vsbzo6c29tYSgpewogICAgaW50IHZhbG9yMSA9IDI7CiAgICBpbnQgdmFsb3IyID0gMzsKICAgIHRvdGFsID0gdmFsb3IxICsgdmFsb3IyOwogICAgcmV0dXJuICh0b3RhbCk7Cn0KZG91YmxlIEVmZXR1YV9jYWxjdWxvOjpkaXZpZGUoKXsKICAgIGludCB2YWxvcjEgPSAyOwogICAgaW50IHZhbG9yMiA9IDM7CiAgICB0b3RhbCA9IChkb3Vib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