Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this assignment is to assess if you can create a program that uses a Stack and a Linked List. Directions Points The

The purpose of this assignment is to assess if you can create a program that uses a Stack and a Linked List.

Directions Points
The file must be called unit5-6Prog.cpp 1
Create a structure called AddressNode

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

10
Create classed called ABook.

Create the Default Constructure. (public)

Create the Deconstructor. (public)

AddressNode* topPtr. (private) Should be a pointer to the top of the list.

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

ABook::ABook() Default Constructor

ABook::Insert(string NewItem) Add item to the Linked List

ABook::SortedInsert(string NewItem) Add item to the Linked List (sorted)

ABook::Remove(string& item) Remove element from the top of the stack and return the item.

ABook::~ABook() Deconstructor. Removes all elements from the list.

40
Main Method

Declare new List (Hint: ABook Book;)

Declare new string newName.

Declare new string nameToRemove.

Call Book.Insert(Precious); - Insert Precious into list.

Call Book.SortedInsert(Ken); - Insert Ken into listed (sorted)

Call Book.SortedInsert(Eileen); - Insert Eileen into list (sorted)

Call Book.SortedInsert(Frank); - Insert Frank into list (sorted)

Use Book.Remove to remove each name one at a time and display to screen.

Include: system("PAUSE"); after your output to pause the screen.

See example below.

10
Ensure you include ALL .cpp file(s) and any associated, student-defined .h (header) files required to make your program compile and run. The only files in the dropbox should be .cpp and .h files. Do not turn in .zip, .exe, .rar, etc files. 2

Submit your page.

NOTE: Complete your activity and submit it by clicking on the Submit Assignment link at the top right of this screen.

3

Total Possible Points

76
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

More Books

Students also viewed these Databases questions

Question

6. Explain how to train managers to coach employees.

Answered: 1 week ago

Question

5. Tell how job experiences can be used for skill development.

Answered: 1 week ago

Question

4. Explain the characteristics of successful mentoring programs.

Answered: 1 week ago