Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PROGRAM Your goal is to demonstrate that you know how to implement single link forward linked lists - do not waste time finding ways

C++ PROGRAM

Your goal is to demonstrate that you know how to implement single link forward linked lists - do not waste time finding ways to avoid implementing the linked list algorithms.

Create an Element class that contains the data and pointers for a single-link forward link list for this application. Your linked list must consist of objects of this class. The class should contain at least the following elements (you may have more if you wish):

  • The standard four constructors (default, parameterized, copy, move)
  • The standard assignment operators (copy, move)
  • A destructor
  • Stream operators (<< and >>)
  • The standard relational operators
  • Accessor for all instance variables
  • Mutators for all instance variables

The instance variables must be pointers, and they must be private.

Create a List class that implements the List ADT for objects of the Element class in a single-linked forward linked list. The List class must contain at least the following elements (you may have more if you wish):

  • The standard four constructors (default, parameterized, copy, move)
  • The standard assignment operators (copy, move)
  • A destructor
  • Stream operators (<< and >>)
  • The standard relational operators
  • Accessor for all instance variables
  • Mutators for all instance variables
  • Insert a new element into the list by position. This method can be used for general insertion, as well as push and append operations.
  • Remove an element by position. This method can be used for general removal, as well as pop and trim operations.

The instance variables must be pointers, and they must be private.

create main.h and main.cpp source code files that contains the C++ source code for a program that

  1. Accepts an input file name from the user
  2. If the input file can not be opened, display an appropriate message and end the program.
  3. Create a list of the words that appear in the file, along with the number of times each word appears. Each list element must be an object of the Element class, and the list must be an object of the List class. All list operations must be done using the standard class operators, accessors, mutators, and constructors. Your list should not have any duplicate words. There is no need to display the list in any particular order (no need to sort the list).

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

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions