Please find the C++ code from today's tutorial here. Please add comments to your code as your understand the lines. Please feel free to post questions to this forum if you have any difficulties.
Please note: as you have not covered strings in C++ yet, these have not been included in this example. I will update the files when strings have been covered, either in lectures or in tutorials.
Using the class in your main function:
Read pages 9-11 (Term 2 Week 4 lecture 2)
Instantiate some objects with students (they do not have names yet, as strings are not used). Name the object after the student, then use the methods of the class to change some details. Then print the values of those objects.
For example:
sseStudent bob;
bob.setDegree(3);
/*using a code to represent the degree course - we haven't actually specified what code is for what course yet...*/
//we can use comments like this in C++
bob.setApplied(true);
cout << "Bob is on degree program " << bob.getDegree() << "." << endl;
if(bob.isApplied())
{
cout << "Bob is on an applied course." << endl;
}
Please ask for help if you need it. Feel free to expand the class or create your own examples of objects/classes - I'm always appreciative of good ideas!