Supplied file(s) $sub05/demo_names_list (the demo executable)
$sub05/names_list.txt (the "TextItems" file containing program information)
$sub05/names_list.o (the pre-compiled driver)
$sub05/functions.h (the specification file containing prototypes for the functions you must write)
Files to submit functions.cpp (the source code file containing your function definitions)
names_list (your executable)
my_tests.sh (your testing script)
Where to put them Copy them to your u##/submissions/s05 directory.
When they're due Sunday, March 2, 2025 @11:59pm

Overview

The main goal of this week's submission is to give you an opportunity to write some C++ code that uses pointers and gets its storage from the free store, but there is also a point at which you may find the STL useful as well, depending on how you write one of the functions.

Your job will be to implement the functions whose prototypes have been given in the functions.h specification file, and place your function definitions in a file called functions.cpp, which will then be separately complied and linked with the instructor-supplied driver file names_list.o to produce your final executable file names_list. This procedure is, of course, the same one used for the previous submission.

Steps to Perform

  1. Copy the demo executable file and run it, first without any command-line parameters to see the opening screen, followed by a single screen of program description and usage information.
  2. Study the program description screen until you understand what the input and output of the program are supposed to be.
  3. Run the program a few more times, with different values of the single command-line parameter input value. Verify that the program behaves as advertised, and try to get a mental fix on the format of the output.
  4. Study the supplied specification file (the functions.h file) to see what functions you have to write. It contains a prototype for each of the required functions, along with a brief doxygen-style comment describing what task that function performs when the program runs.
  5. Write pseudocode for these functions, and hence for a solution to the problem. Revise your pseudocode until you are convinced that its implementation will do the job.
  6. Translate your pseudocode into C++, link it with the supplied driver to build an executable, and continue testing until you are convinced that everything works correctly. [See below for some (repeated)mhints on this process.]
  7. Make sure your source code is identified, formatted and documented properly, according to our current rules and guidelines.
  8. Finally, submit the required files by copying them to the appropriate subdirectory in your uxx account.

Additional Notes, Requirements, Specifications and/or Hints (if any)

  1. As in the previous submission, your ID information that gets displayed on the opening screen must be made available to the supplied driver by the following line at the beginning of your functions.cpp file:
    extern const string MY_ID_INFO = "\t\tLastname:Firstname:A00123456:u??";
    
    Make sure, of course, that it contains your information, and not the generic information shown.
  2. Also, as in the previous submission, there are at least two distinct ways to proceed when you are writing and testing your code, and you can check the previous submission description for a description of those two approaches.
  3. You will find it helpful to create a build.sh script similar to the one supplied for the previous submission to build your executable for testing at each stage of the development, and for eventually building the final executable for submission. You will also need a testing script to test each iteration of the executable as you develop your program, and this is, as usual, one of the files to be submitted.