CPSC 427: Object-Oriented Programming

Michael J. Fischer

Lecture 9
September 28, 2016

Bar Graph Demo (continued)

Analysis of 08-BarGraph demo

main.cpp

Points to note:

Design issues for main.cpp

1.
Should instructions be a static class method or a static constant?
2.
Should fname be a char[] or a string? If the latter, how does one prevent buffer overrun?
3.
Where should the file opening code go – in run() (where it is now), in Graph, or in a new controller class?

graph.hpp

Points to note:

graph.cpp

Points to note:

Class discussion on bargraph design issues

Most of class time was spent discussing the design issues raised above in main.cpp, graph.hpp, and graph.cpp.