

--------------------------------------------------------------------------------------------------------------
Contacts.h
#ifndef Contact_H
#define Contact_H
#include<string>
using namespace std;
class ContactNode{
public:
ContactNode();
ContactNode(string name, string phone);
void InsertAfter(ContactNode*);
string GetName();
string GetPhoneNumber();
ContactNode* GetNext();
void PrintContactNode();
private:
string contactName;
string contactPhoneNum;
ContactNode* nextNodePtr;
};
#endif
--------------------------------------------------------------------------------------------------------------------------------------------
Contacts.cpp
#include <iostream>
#include "Contacts.h"
using namespace std;
ContactNode::ContactNode(){
nextNodePtr=NULL;
}
ContactNode::ContactNode(string name, string phoneNum){
contactName=name;
contactPhoneNum=phoneNum;
nextNodePtr=NULL;
}
void ContactNode::InsertAfter(ContactNode *nextNode){
ContactNode *temp;
if(nextNodePtr==NULL)
nextNodePtr=nextNode;
else{
temp=nextNodePtr;
while(temp->nextNodePtr!=NULL){
temp=temp->GetNext();
}
temp->nextNodePtr=nextNode;
}
}
string ContactNode::GetName(){
return contactName;
}
string ContactNode::GetPhoneNumber(){
return contactPhoneNum;
}
ContactNode* ContactNode::GetNext(){
return nextNodePtr;
}
void ContactNode::PrintContactNode(){
ContactNode *temp;
if(nextNodePtr!=NULL) {
cout<<"Contact Name: "<<nextNodePtr->GetName()<<endl;
cout<<"Phone number: "<<nextNodePtr->GetPhoneNumber()<<endl<<endl;
GetNext()->PrintContactNode();
}
}
--------------------------------------------------------------------------------------------
main.cpp
#include <iostream>
#include "Contacts.h"
using namespace std;
int main()
{
ContactNode *List,*head;
string Name;
string PhoneNum;
List=new ContactNode;
for(int i=0;i<3;i++){
cout<<"\nPerson " <<i+1<<endl;
cout<<"Enter name: "<<endl ;
// cin>>Name;
getline(cin, Name);
cout<<"Enter phone number: "<<endl ;
// cin>>PhoneNum ;
getline(cin, PhoneNum);
cout<<"You entered: "<<Name<<", "<< PhoneNum<<endl ;
List->InsertAfter(new ContactNode(Name,PhoneNum));
}
cout<<endl<<endl<<"CONTACT LIST"<<endl<<endl;
List->PrintContactNode();
system("pause");
return 0;
}
--------------------------------------------------------------------------------------------
SEE OUTPUT

Thanks, PLEASE UPVOTE
20.6 Lab: Contacts You will be building a linked list. Make sure to keep track of both the head and tail nodes (1) Create three files to submit. ContactNode.h-Class declaration ContactNode.cpp- Class...
(In C) 8.12 LAB: Warm up: Contacts You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. ContactNode.h - Struct definition, including the data members and related function declarations ContactNode.c - Related function definitions main.c - main() function (2) Build the ContactNode struct per the following specifications: Data members char contactName[50] char contactPhoneNum[50] struct ContactNode* nextNodePtr Related functions CreateContactNode() (2 pt) InsertContactAfter() (2 pts) Insert...
Hello I need some help with my CC+ project.
My current project erasing the first two phone numbers and only
printing the 3rd phone number out in the list. Any idea on how to
correct.
Here is the error.
Contacts.h
#ifndef Contact_H
#define Contact_H
#include<string>
using namespace std;
class ContactNode{
public:
ContactNode();
ContactNode(string name, string phone);
void InsertAfter(ContactNode*);
string GetName();
string GetPhoneNumber();
ContactNode* GetNext();
void PrintContactNode();
private:
string contactName;
string contactPhoneNum;
ContactNode* nextNodePtr;
};
#endif
Contacts.cpp
#include <iostream>
#include "Contacts.h"...
Declare and define TtuStudentNode in TtuStudentNode.h and TtuStudentNode.cpp file. TtuStudentNode has its unique string variable "studentEmail" which contains email address. TtuStudentNode has its unique function member GetEmail() which returns the string variable "studentEmail". TtuStudentNode has its overriding "PrintContactNode()" which has the following definition. void TtuStudentNode::PrintContactNode() { cout << "Name: " << this->contactName << endl; cout << "Phone number: " << this->contactPhoneNum << endl; cout << "Email : " << this->studentEmail << endl; return; } ContactNode.h needs to have the function...
Ch 8 Program: Playlist (Java)You will be building a linked list. Make sure to keep track of both the head and tail nodes.(1) Create two files to submit.SongEntry.java - Class declarationPlaylist.java - Contains main() methodBuild the SongEntry class per the following specifications. Note: Some methods can initially be method stubs (empty methods), to be completed in later steps.Private fieldsString uniqueID - Initialized to "none" in default constructorstring songName - Initialized to "none" in default constructorstring artistName - Initialized to "none"...