Question
C++ Question: You will submit three files: A simple test program for your List class -- your test program must use at least the test
C++ Question:
You will submit three files:
A simple test program for your List class -- your test program must use at least the test case shown below
Your List class header file
Your List class implementation file
This implementation of the List class needs an internal member that is an array. The member functions will need to know how many values that array can hold and take care not to overflow the array. The solution below has an internal limit of 50 values. (FYI, we will revisit this same problem in a future lesson when we learn about dynamically expanding arrays, and will implement a better version that has no inherent limit.)
Here is the core of a simple test program for a list class object.
// First add some data
for (int i = 0; i
{
cout
cin >> temp;
testList.addValue(temp);
}
// Exercise member functions
cout
cout
cout
testList.deleteLast();
cout
cout
while (!testList.full())
{
testList.addValue(100.0);
}
cout
Write a program that will read a line of text and output a list of all the letters that occur in the text together with the number of times each letter occurs in the line. End the line with a period that serves as a sentinel value. The letters should be listed in the following order: the most frequently occurring letter, the next most frequently occurring letter, and so forth. Use two arrays, one to hold integers and one to hold letters. You may assume that die input uses all lowercase letters. I' or example, the input do be do bo. should produce output similar to the following: Letter Number of Occurrences 2 2 Your program will need to sort the arrays according to the values in the integer array. This will require that you modify the function sort given in Display 7.12. You cannot use sort to solve this problem without changing the function. If this is a class assignment, ask your instructor if input/output should be done with the keyboard and screen or if it should be done with files. If it is to be done with files, ask your instructor for instructions on file names
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started