Classes and ShowMe()

Hello guys and gals. I am very new to C++ and I am working on this code assignment but I ma lost and do not know how to do it. Can anyone help me please.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "stdafx.h"
#include <string>
#include "CourseOffering.h"

using namespace std;



CourseOffering::CourseOffering(void)
{

	// To Do - It is better to create an empty CourseOffering instance and then
	// use its setter methods to set the various attributes in main()
	CourseId = 312;
	CourseName = "Software Dev w/c++";
	Instructor = "Dr. Osama Morad";
}

// To Do - need to provide a ShwoMe() body implementation here
// See the class forum for an example

CourseOffering::~CourseOffering(void)
{
}
You can see my blog post at http://www.mycpptutor.com/blog/2015/03/31/how-to-get-unstuck-on-your-programming-assignment/ to help with this. Specifically, the "plan" section and the "focus on requirements" sections might help.

Let's try breaking this down...
1) You need to have an empty course. This means in the constructor, you need to set CourseId, CourseName, and Instructor to something that represents "empty".
2) Implement the ShowMe function. This should probably display the member variable name and the value of that member variable (but I'm just guessing... I don't now for sure). You should be able to call it from main and you see the empty values you set in step 1. Compile and run your program to see that.
3) Try adding one setter method for just one of those member variables. In main, set that value then call ShowMe. Compile your code and run it (you should, for example, be able to set course ID to 312 and immediately see it get changed when the ShowMe function is called).
4) Do the same thing for the other member variables.

Good luck!
Topic archived. No new replies allowed.