In particular:
1. Times and dates will no longer necessarily be formatted properly; you should check and reject any malformed times and dates.
2. Your time and date data should be stored in a way that allows you to do arithmetic with times and dates. In particular, youre going to want to know if one moment in time comes before another, how long an activity lasts (i.e. the difference between two times) and more.
3. Your collection of activities should be stored in an object, and so therefore you should have an ActivityCollection class (does not have to have this exact name).
4. Your ActivityCollection class should contain a dynamically allocated growable C++ array (you may not use vectors for CP2).
Test your ActivityCollection class. Since the class uses the heap, the copy constructor, assignment operator, and destructor should all be implemented. Your ActivityCollection class should make deep copies. Write your own test program that creates an activity collection, populates it with some activities, uses the copy constructor and assignment operator to create and copy the object into other objects, passes the collection to a function, returns an activity collection from a function, etc. Write two separate functions, called testAssignment() and testCopyConstructor() (these functions can and should call other test functions to test different aspects of your code). Be sure to demonstrate that if you change activities in one collection, they are not changed in other collections. Create ActivityCollection objects that are global variables, local variables within a function, pass-by-value parameters, and dynamical
ly allocated. Well be looking for all of these things
label them clearly in your code with both comments and clear descriptive variable and function names.
Please have your test code (at least for testing the copy constructor and
assignment operator) compile into a separate executable, using make test.
And please include in a README.md file the instructions for running your test
code (this can just be the name of the executable if you dont have command
line arguments
thats fine). The code should be self contained
nobody
should have to type anything in to the terminal in order to run it. (You can
create activities, users, etc., by calling your functions directly instead of
from the menu
. this code is testing the copy constructor and assignment
operator, not the menu.) If you require the menu for testing, you should have
your tests in input files, ready to go, and your README.md file should contain
explicit instructions to run your code by piping in the input file. Running
your test code through valgrind should reveal no memory leaks.
Extend your top level menu to support the notion of a user, as follows.
Register
should create a new user in the system, after checking that the username is not already taken. This item should prompt for a first name, last name, and password (may be empty).
Login
prompts for the password and if it matches s password, this user is logged in.
Logout
logs out the currently logged-in user, if any.
Update Create and Display to add activities to each users collection of activities, instead of to just one global collection of activities associated with the entire program.