Week 7 Class 12 Tue Feb 23 Posted: Feb 23
Class session:
After the screencast on Project 2 and the Structure Chart exercise, there are 3 options for the remainder of the class session:
A Study for the Midterm Exam. View the screencasts after the Midterm Exam or when you work on parts v2b and up in Project 2.
B Start work on Project 2, v2a, where you correct issues from Project 1 (see announcement below). View the screencasts after the Midterm Exam or when you work on the rest of Project 2.
C View the screencasts now.
A reminder that the Midterm Exam 1 is on Thursday in Leigh Hall 307. I updated the description of the exam and process, so make sure to read it over.
I am starting to post feedback and score for Project 1. Many of the issues found are already posted as Issues in your GitHub Repository. The rest of the feedback will be in Brightspace along with your score. As I finish, I will update this note.
The Docker Report screencasts apply to things that are part of Project 2. Like the previous Docker Report screencasts, they provide an example of much of what you need to do for Project 2.
Exercise 33: Structure Chart
The Docker Report program has an internal alternative design in the branch alternative. To view the alternative design, clone the repository OOPS21-DockerReport. Then, switch to this branch using the command:
git checkout alternative
In this design, the free functions in yaml_parser.cpp call another set of functions local to the file yaml_parser.cpp, e.g., skipWhitespace(). The purpose of these local functions is to perform further algorithmic decomposition. They are not for use in any other program or file.
A function definition in any .cpp file can be linked to, even without an include file. For free functions to be completely private to a file, there are two choices. One is the use of the static
keyword, e.g., static void f() {...}
can only be called in the file that contains the declaration. The more C++ way is to use an anonymous namespace, e.g., namespace { ... }
. Anything in an anonymous namespace can only be called in the file that contains that namespace.
Your assignment is to create a Structure Chart for this alternative design. All of the functions in this alternative design should be in the chart. Label the topmost node Generate Docker Report. All function definitions that are in the alternative design need to appear in the chart. The resulting chart should have 3 levels. The Algorithmic Decomposition Notes contains examples including Generate Payroll and Rainfall.
Submit to Brightspace as a PDF or any image file. A photo using your phone is fine. If you want to use a drawing program, go ahead and do so.
Screencast: Docker Report: Extract Class Wrapper
If you are following along in your own repository, there is a change to the CMakeLists.txt file for the build to find YAMLParser.obj. Change:
# Source files for the main program DockerReport
set(SOURCE DockerReport.cpp yaml_parser.cpp)
to:
# Source files for the main program DockerReport
set(SOURCE DockerReport.cpp YAMLParser.cpp yaml_parser.cpp)
Screencast Folder: Class 12 Tue Feb 23
Exercise Due Date: 4 pm on Wednesday, Feb 24
Reminders: