Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can somebody check this program and help me because i goterrors and i couldn\'t

ID: 3615738 • Letter: C

Question

Can somebody check this program and help me because i goterrors and i couldn't compile it. #include <iostream> using namespace std;
class CustomerData { private: int id; int age; int pnumber; int creditcard;
public : CustomerData(int id,int age, int phone, int credit); void security_preferences(); void print_secure(); void print_all(); };
CustomerData::CustomerData(int id,int age,int phone,intcredit) { id=i; age=20+rand()%60; phone=1000000+rand()%2000000; credit=1000+rand()%2000; } void CustomerData::security_preferences() { cout<<0+rand()%1; } void CustomerData::print_secure() { cout<<"id: "<<" "<<id<<"age"<<""<<age<<endl; } void CustomerData::print_all() { cout<<"id :"<<id<<"age:"<<age<<"phone: "<<phone<<"credit:"<<credit<<endl;
}
int main() { int i; CustomerData cust[50]; for (i=0;i<50;i++) cust[i].CustomerData(i); do { cout<<"Enter customer id between 0 and 49:"<<endl; cin>>i; if(i>49) cout<<"invalid customer number"<<endl; } while(i>49); while (i>=0) { if (cust[i].security_preference()==1) cust[i].print_secure(); else cust[i].print_all(); do { cout<<"enter customer id: "<<endl; cin>>i; if(i>49) cout<<"invalid customer number"<<endl; } while(i>49); } return 0; } Can somebody check this program and help me because i goterrors and i couldn't compile it. #include <iostream> using namespace std;
class CustomerData { private: int id; int age; int pnumber; int creditcard;
public : CustomerData(int id,int age, int phone, int credit); void security_preferences(); void print_secure(); void print_all(); };
CustomerData::CustomerData(int id,int age,int phone,intcredit) { id=i; age=20+rand()%60; phone=1000000+rand()%2000000; credit=1000+rand()%2000; } void CustomerData::security_preferences() { cout<<0+rand()%1; } void CustomerData::print_secure() { cout<<"id: "<<" "<<id<<"age"<<""<<age<<endl; } void CustomerData::print_all() { cout<<"id :"<<id<<"age:"<<age<<"phone: "<<phone<<"credit:"<<credit<<endl;
}
int main() { int i; CustomerData cust[50]; for (i=0;i<50;i++) cust[i].CustomerData(i); do { cout<<"Enter customer id between 0 and 49:"<<endl; cin>>i; if(i>49) cout<<"invalid customer number"<<endl; } while(i>49); while (i>=0) { if (cust[i].security_preference()==1) cust[i].print_secure(); else cust[i].print_all(); do { cout<<"enter customer id: "<<endl; cin>>i; if(i>49) cout<<"invalid customer number"<<endl; } while(i>49); } return 0; }

Explanation / Answer

please rate - thanks you are missing the fill_values as in the definition of theproblem your variables were pnumber & creditcards, you were thencalling them phone and credit, couple of other minor things, I'vetried to highlight all the changes solution without pointers    - I also fixed your 2output lines, added spaces #include using namespace std; class CustomerData { private: int id; int age; int pnumber; int creditcard; public : CustomerData();       void fill_values(int i); int security_preferences(); void print_secure(); void print_all(); }; CustomerData::CustomerData() {} void CustomerData::fill_values(int i) { id=i; age=20+rand()%60; pnumber=1000000+rand()%2000000; creditcard=1000+rand()%2000; } int CustomerData::security_preferences() { return 0+rand()%1; } void CustomerData::print_secure() { cout