SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,julia Lobur
Chapter:
Friends Overloaded Operators And Arrays In Classes
Exercise:
Programming Projects
Question:11 | ISBN:9780321531346 | Edition: 7

Question

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. The member function get_last 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.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.