Im have trouble with creating classes. I got the private part down packed but the public part is where I have a little trouble. In my program my professor wants me to do a program on amicable pairs. I have the equations I want just that Im missin a declaration which I have no idea what that means. Here's my code so far:
Code:
#include<iostream>
using namespace std;
class Apair
{
private:
int A;
int T;
int S;
int B;
int F;
int D;
public:
A = 220;
while(A <= 7000){
S = 0;
D = 1;
D = A/2;
if(A % D = 0){
S = S+ D;
}
D++;
if(S > A){
B = S;
T = 0;
for(F = 1)
if(B % F = 0){
T = T+ F;
}
if(T = A){
cout << &A& " and " &B& "are an amicable pair" << endl;
}
F++;
A = A + 1;
}
}
};