10.14 Lab: Warm Up: Contacts
Tin can any ane assist, I dont sympathize what I am actually doing and having trouble wrapping my head around the significant of my class and its members and the member functions.
This is my assignment
Assignment Ii - Contacts (Linked List)
You will be building a linked list. Make certain to keep rail of both the head and tail nodes.
(1) Create three files to submit
• Contacts.h - Class declaration
• Contacts.cpp - Class definition
• chief.cpp - main() office
(2) Build the node class for your contacts per the post-obit specifications:
• Parameterized constructor. Parameters are name followed by phone number.
• Public fellow member functions
o InsertAfter()
o GetName() - Accessor
o GetPhoneNumber - Accessor
o GetNext() - Accessor
o PrintContactNode()
• Individual information members
o cord contactName
o cord contactPhoneNum
o ContactNode* nextNodePtr
Case. of PrintContactNode() output:
Name: Roxanne Hughes
Phone number: 443-555-2864
(3) In main(), prompt the user for three contacts and output the user'south input. Create three ContactNodes and use the nodes to build a linked list.
Example:
Person 1
Enter name:
Roxanne Hughes
Enter telephone number:
443-555-2864
You entered: Roxanne Hughes, 443-555-2864
Person two
Enter name:
Juan Alberto Jr.
Enter phone number:
410-555-9385
You entered: Juan Alberto Jr., 410-555-9385
Person 3
Enter name:
Rachel Phillips
Enter phone number:
310-555-6610
Y'all entered: Rachel Phillips, 310-555-6610
(four) Output the linked list.
Example:
CONTACT Listing
Name: Roxanne Hughes
Phone number: 443-555-2864
Proper noun: Juan Alberto Jr.
Phone number: 410-555-9385
Proper name: Rachel Phillips
Phone number: 310-555-6610
we need three sections
contacts.h given by professor
contacts.cpp
primary.cpp
contacts.h
| |
what i have come up up with, it tells me i need an initializer earlier GETNAME and GETPHONENUM??
contacts.cpp
| |
you swapped types on your functions.
get name and get telephone are strings in the class header but void below .. string seems to be correct.
| |
| |
Your code is OK as far as information technology goes. To go it to run there need to be a few changes marked with the arrows. Some needs to be completed such as the cin statement to create a new contact and therefor a new node.
Once you can create individual contacts and get them working yous tin then add together them every bit nodes (pointers) to the linked list you build into the Class. You need head node class fellow member etc as for an ordinary linked list
Last edited on
10.14 Lab: Warm Up: Contacts,
Source: https://cplusplus.com/forum/general/212400/
Posted by: rodriguezwiterestich.blogspot.com
0 Response to "10.14 Lab: Warm Up: Contacts"
Post a Comment