CS372 Assignment #3: Classes and Unit Tests This assignment has 2 problems, for a total of 100 points. Submission Instructions Clone the assignment repository from Github Classrooms. Using Visual...

1 answer below »
Instructions Attached


CS372 Assignment #3: Classes and Unit Tests This assignment has 2 problems, for a total of 100 points. Submission Instructions Clone the assignment repository from Github Classrooms. Using Visual Studio, add a new project in the VS solution for the first question. Implement the List class in the MiniSTL project, and add an additional project for any test applications you write. To submit, please push your code to Github. Points will be deducted if you do not follow these instructions. 1. (50 points) You need to keep track of the tasks you need to complete to finish this homework. Using your Vector, List, and Queue classes, write a program that allows you to maintain the text file that you use to track the tasks. Assume the file has one entry per line of text, with each line having a task number, a space, a single character with “U” for undone and “D” for done, a space, and then the task description. Write a menu-driven program that allows the user to select: (1) display all items, (2) display selected item, (3) mark a task as done, (4) exit the program. On exit, update the file by writing the undone tasks back to file. HINT: This is an exercise in the use of traverse() and function pointers. 2. (50 points) Let’s consider an alternate way of implementing iterators. The C++ concept of iterators was an attempt to make iterators behave like pointers so that you could write a for-loop with iterators in the same manner as with pointers. Other programming languages take a more simple approach: design iterators so that they behave like a stream. The iterator walks through the associated container, item by item until it reaches the end of the data. At that point it returns nullptr. That means that we can use a while-loop to traverse through a container. Suppose we have a pure virtual class that defines the interface for an iterator: template class Iterator { public: virtual C * next() = 0; } Modify your sequence container classes to include support for this class. The classes will need to inherit from this class, provide the implementation of next(), and will need some way of keeping track of where the iterator is currently positioned in the implementing class (may need additional private variables in the class). Return nullptr when the iterator is at the end of the container.
Answered 1 days AfterFeb 13, 2022

Answer To: CS372 Assignment #3: Classes and Unit Tests This assignment has 2 problems, for a total of 100...

Kshitij answered on Feb 15 2022
105 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here