1.While working (better still, even before working) on the exercises, you may find the viewing the videos from Buckyâs C++ Programming Tutorials useful. You should consider starting from the beginning of the video tutorial series at https://www.youtube.com/watch?
You must practice writing the code shown in the videos using the codeblocks IDE.
The video starts with installation of codeblocks â an IDE. Use the latest version of the IDE with mingwwhen working with the videos. Use the videos together with the unit textbook. The videos and the textbook are not a replacement for the lecture material as both the videos and textbook deal mainly with C++ syntax and do not cover issues with Object Orientation.
Go through the four chapters indicated earlier. You would have encountered these concepts from these chapters before using a different programming language. You need to go through these chapters to find out how these concepts are handled in C++. Â You need to learn how to program in C++.
In chapter 1, you will learn how a basic C++ program is structured. Each line of code is explained. Subsequent chapters build on the previous chapters. If you have never written a C++ program before, you must go through the examples shown in the textbook. Chapter 3 on Input/Output would be something new to you if you have not worked with C++ before. The lecture notes would be using different examples so that you get a variety of examples.
Complete the following exercises before you come to the laboratory class.  Use the time in the laboratory class to obtain any help you need. You should attempt the exercises first before looking for the answers.
When completing the questions from My Unit Readings, do not read the question and then look at the answer without first trying out the question yourself. If you do, you will pay for this later when you get stuck and canât figure it out yourself and no answers are available for you to copy.
Do the following questions and check your answers. Questions and Answers are at libraryâs My Unit Readings for this unit. See advice above.
2. Go through the chapter on Classes and Data Abstraction of the textbook that you have âC++ Programming: Program Design Including Data Structuresâ by Malik and attempt the following questions from the My Unit Readings at the library site, and compare your answers with those given in the document. You need to start work on these exercises beforeyou come to the laboratory class. Â Use the time in the laboratory class to obtain any help you need.
Exercise 1 on page 650
Exercise 3 on pages 650 â 651
Exercise 5 on page 652
Exercise 7 on page 653
Exercise 9 on page 654
Once you have completed the above, attempt the other (even numbered) exercises on pages 650 - 653.
Â
3. Before starting this exercise and any subsequent exercises, you should have completed the above exercises and the PowerPoint slides for this topic.If you proceed without completing all of the above, you can get lost and confused.
In the folder âslide examplesâ, Lec-03-CD-V02.zip contains the source files from the slides for topic 1. Some code changes were made for this exercise. Examine the code using codeblocks, compile and run the code. Fix any errors â see below.
Which constructor is used for creating the track2 object?
Is the output of track2 correct? How would you fix it? Fix the problem and run the program again.
Think of why the output of track2 has gone wrong and how would you prevent the client programmer from making use of your Track class incorrectly.
4. If doxygen, graphviz and staruml are not installed, please install them on your machine.
For Doxygen:
You run Doxygen on the code from Lec-03-CD-V02.zip.
On the Source Browser tab, tick everything except Use_Htags. Make sure that the HTML output has graphical relations displayed. Do not select Latex, RTF or Man output in their respective tabs.Â
You will find that the doxygen tool not only helps with documenting the code but also helps you to find errors in your design or implementation.Â
After you have learned how to use the doxygen tool, learn how to comment your source code using doxygen style comments. Explanation with examples is provided doxygen manual. A version of this manual is available doxygen at the unit site. You can read all of it or start at the chapter on "Documenting the code".Â
Once Doxygen has finished running on your code, look at the html directory created by doxygen. Load any html file from there and explore. An example is found in Practice. Look at DoxyExample. Donât worry if you donât fully understand the C++ code yet. You will need to complete the various topics in ict283 first. For this topic, it is only about writing doxygen comments.
5. Starumldemo2C++.zip contains an example used in the lecture do demonstrate how to use the tool StarUML. The tool can generate C++ code from the design and you might want to try it out. You are advised not to rely on it for being totally correct. If you make changes to the source code and you recreate the source again from the UML diagram, the changes you made will be lost as the files get over written.Â
StarUML.pdf is a quick introduction on how to use StarUML. You need to explore StarUML to find out how it works. We are concerned with the Design Model and StarUML can do a lot more but is not needed for our purposes. In the Model Explorer window you will see Design Model. Open this up and as you build your classes, examine what happens there.Â
6. Experiment with StarUML. Learn how to draw classes. Â You may use the staruml found in the software folder.