Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project you will redo Programming Project 8 from Chapter 11 using a linked list instead of an array. As noted there, this is

In this project you will redo Programming Project 8 from Chapter 11 using a linked list instead of an array. As noted there, this is a linked list of double items. This fact may imply changes in some of the member functions. The members are as follows: a default constructor; a member function named add_item to add a double to the list; a test for a full list that is a Boolean-valued function named full( ); and a friend function overloading the insertion operator

Project 8 Chapter 11

Define a class called List that can hold a list of values of type double. Model your class definition after the class TemperatureList given in Display 11.10, but your class List will make no reference to temperatures when it outputs values. The values may represent any sort of data items as long as they are of type double. Include the additional features specified in Self-Test Exercises 21 and 22. Change the member function names so that they do not refer to temperature. Add a member function called get_last that takes no arguments and returns the last item on the list. The member function get_last does not change the list, and it should not be called if the list is empty. Add another member function called delete_last that deletes the last element on the list. The member function delete_last is a void function. Note that when the last element is deleted, the member variable size must be adjusted. If delete_last is called with an empty list as the calling object, the function call has no effect. Design a program to thoroughly test your definition for the class List.

Display 11.10

image text in transcribed

image text in transcribed

Exercises 21 and 22

image text in transcribed

DISPLAY 11.10 Program for a Class with an Array Member (part 1 of 2) 1 /This is a definition for the class //Temperaturelist. Values of this type are lists of Fahrenheit temperatures. 2 #1 nclude #include 4 5 6 using namespace std; 8 const int MAX_LISTSIZE50; 10 class TemperatureList 12 public: 13 14 15 16 17 18 19 20 21 TemperatureList(; /Initializes the object to an empty list void add temperature(double temperature); //Precondition: The ist is not full //Postcondition: The temperature has been added to the list bool ful1) const; /Returns true if the list is full false otherwise friend ostream& operator

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_2

Step: 3

blur-text-image_3

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

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

Types of physical Maps?

Answered: 1 week ago

Question

Explain Intermediate term financing in detail.

Answered: 1 week ago