I graded and posted Project 1 scores in Brightspace. Feedback is in:
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:
Continue to improve the design of srcFacts using more language features. For this project, there are no changes to the functionality, only to the design.
Tag “v2a” Implement and close all issues from Project 1. When you finish fixing an issue, create a tag for that commit in the form issueN tag where N
is the issue number, e.g., when you complete issue1, create the tag issue1. Due Mar 1.
From this point on, do not make any changes to the files xml_parser.hpp or xml_parser.cpp.
Tag “v2b” Create the class XMLParser in files XMLParser.hpp and XMLParser.cpp where the methods call the free functions from xml_parser.hpp. Do not use any fields/data members. The method parameters must be identical to the parameters of the free functions in xml_parser.{hpp,cpp}.
Tag “‘v2c’” Eliminate any parameters in the XMLParser methods that you can, replacing them with field/data members in the class. In other words, move as many of the XML parsing variables from srcFacts.cpp as you can. Do this one field/data member at a time.
Tag “v2d” Inline the calls to the xml_parser free functions into your XMLParser methods. Inlining the calls does not mean adding the inline
specifier. Do this one free function call at a time. At the end, your XMLParser.cpp should have no calls to xml_parser functions, and will not need to include xml_parser.hpp. Do not make any changes to the files xml_parser.{hpp,cpp}.
Tag “v2e” Use inversion of control on the while loop/nested-if in srcFacts so that the entire loop is inside of XMLParser.
Unless state otherwise, all parts of Project 2 are Due Mar 8.
At every commit, make sure the project compiles, builds, and produces the correct answer.
The first Midterm Exam is 12:15 - 1:30 pm on Thursday, Feb 25.
The exam is on-campus in Leigh Hall 307.
Notes:
You are responsible for the following:
The exam has various problem types, including short answer, definition, comparison, drawing diagrams, and coding.
Questions are from what I covered in class, the book, the exercises, and the projects. If I did not cover it in class, it is not on the exam.
Notes - Includes short Guides
Textbook: A Tour of C++, 2nd Edition by Bjarne Stroustrup, Addison-Wesley Professional, June 2018, ISBN: 9780134998053 Safari Books Online
Syllabus: [html]