Question: I need their not to be a class linked List and should just have a pointer to the class within the Phone #include stdlib.h #include

I need their not to be a class linked List and should just have a pointer to the class within the Phone #include stdlib.h
#include iostream
using namespace std;
class Phone {
public:
int Area_code;
int exchange;
int number;
bool unlisted;
Phone *next;
Phone(){
this->Area_code=0;
this->exchange=0;
this->number=0;
this->unlisted=false;
}
Phone(int area,int exc, int num, bool unlist){
this->Area_code=area;
this->exchange=exc;
this->number=num;
this->unlisted=unlist;
}
void setPhone(int area,int exc, int num, bool unlist){
this->Area_code=area;
this->exchange=exc;
this->number=num;
this->unlisted=unlist;
}
void pntPhone(){
cout<<"
(">code;
if(code!=555){
if(code<0|| code>999){
cout<<"
Invalid input";
return 1;
}
cout<<"
Enter the Exchange:";
cin>>exc;
if(exc<0|| exc>999){
cout<<"
Invalid input";
return 1;
}
cout<<"
Enter the number:";
cin>>num;
if(num<0|| num>9999){
cout<<"
Invalid input";
return 1;
}
cout<<"
Is number unlisted: (true: 1,false:0)";
cin>>unlist;
p[i].setPhone(code,exc,num,unlist);
a.addPhone(p[i]);
i++;
}
}
while(code!=555);
for(int j=0;j

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!