Well I asked my professor and he gave me an easier way to do it. I will need to initial a variable and increment it each time the user will add a new client.. but I still have some problems in the code.. here is my code>>
Code:
#include <iostream>
using namespace std;
class healthClubMaintain{
private:
string Al[15];
int counter,i;
string classCleintName;
int classClientIDNumber;
public:
void addClient(string);
};
// Here is the method ... I need to store my inputs in an array and then print them
void healthClubMaintain::addClient(string clientName){
counter=0;
i=0;
if (counter<15){
Al[counter]= clientName;
}
counter++;
while(i<15){
cout<<Al[i];
i++;
}
}
int main(){
int number,loop=0;
int clientIDNumber,programNumber,approvalIDNumber,clientIDA,programNumberA;
string clientName,programName,approvalName;
healthClubMaintain Club;
while ( loop==0){
cout<< "Select one of the following option:"<<endl;
cout<< "(1) Add a new client to the program"<<endl;
cout<< "(2) Display all clients in the program"<<endl;
cout<< "(3) Add a new exercise to the program"<<endl;
cout<< "(4) Display all exercise to the program"<<endl;
cout<< "(5) Add an approval for an exercise for a client"<<endl;
cout<< "(6) Display all approval records in the program"<<endl;
cout<< "(7) Add a performed record to the program"<<endl;
cout<< "(8) Display all preformed records in the program"<<endl;
cout<< "(9) Determine for client(s) performance "<<endl;
cout<< "(10) Exit the program"<<endl;
cin >> number;
if ( number ==1 ){
cout << "Insert the client's name" << endl;
cin >> clientName;
cout << "Insert a new ID" << endl;
cin >>clientIDNumber;
Club.addClient(clientName);
}
}
}