Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program in C++ (Using Class) Problem Specification: An employer would like to maintain a linked list for employees, the data stored is an employee number

Program in C++

(Using Class)

Problem Specification:

An employer would like to maintain a linked list for employees, the data stored is an employee number (a positive integer), number of years on the job (a short positive integer) and a yearly salary (a float). Would like you as the programmer to define the required classes in header files, and the methods in implementation files.

The methods used are:

  • Insert: Which inserts elements at the end of the list, which is the most recent input is at the end of the list.
  • Remove: which deletes the first element in the list.
  • Display: its purpose is to display the list but needs the assistance of a Print function.
  • Print: a recursive function that prints all the elements of the list, last to first.
  • Clear: a function that deletes every Node from the list and leaves the list empty.

Requirements

  • Define a class Node containing the employees data and a pointer to the next Node
  • Define the necessary functions to access, instantiate, and set the data in the class Node.
  • Define a class LinkedList that has only one data member, a pointer to a Node, and the necessary member functions in addition to the member functions above.
  • All mutator functions parameters are constant referenced, and all accessor functions are constants.
  • Functions not accessed by the client, should be private.

criteria:

1. Sufficient comments including specifications

2. Menu is used to display options and calls methods.

3. Guards are used.

4. insert performs it task correctly.

5. remove performs it task correctly.

6. display performs it task correctly.

7. print is recursive and performs it task correctly.

8. clear performs it task correctly

9. all requirements above are included

10. Program runs correctly and performs its task correctly

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

13.4 Discuss how to prepare and use presentation aids effectively.

Answered: 1 week ago