Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Directions The file must be called unit5-6Prog.cpp 1 structure called AddressNode The structure should contain a string for name and a pointer called AddressNode that

Directions The file must be calledunit5-6Prog.cpp1

structure called AddressNode

  1. The structure should contain a string for name and a pointer called AddressNode that points to "next" (the next element in the list).

classed called ABook.

  1. Create the Default Constructure. (public)
  2. Create the Deconstructor. (public)
  3. AddressNode* topPtr. (private) - Should be a pointer to the top of the list.

ABook Methods (each of these methods must be created in your program)

  1. ABook::ABook() - Default Constructor
  2. ABook::Insert(string NewItem) - Add item to the Linked List
  3. ABook::SortedInsert(string NewItem) - Add item to the Linked List (sorted)
  4. ABook::Remove(string& item) - Remove element from the top of the stack and return the item.
  5. ABook::~ABook() - Deconstructor. Removes all elements from the list.

Main Method

  1. Declare new List (Hint: ABook Book;)
  2. Declare new string newName.
  3. Declare new string nameToRemove.
  4. Call Book.Insert("Precious"); - Insert Precious into list.
  5. Call Book.SortedInsert("Ken"); - Insert Ken into listed (sorted)
  6. Call Book.SortedInsert("Eileen"); - Insert Eileen into list (sorted)
  7. Call Book.SortedInsert("Frank"); - Insert Frank into list (sorted)
  8. Use Book.Remove to remove each name one at a time and display to screen.
  9. Include:system("PAUSE");after your output to pause the screen.

Example output of your program

Sorted List:

Eileen

Frank

Ken

Precious

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Corporate communications

Answered: 1 week ago