Question: Good evening!

I'm a beginner programmer and am finishing up my first semester of C++. Currently I'm looking a final exam review sheet my professor gave us and I just don't understand exactly what it's asking me to do. I feel like if I saw an example I would get it immediately but as is I am rather lost.

Here's the review question.

```
Problem: Given the following class definition, implement the class methods. 

class CreditCard {
  public:
    CreditCard(string & no, string & nm, int lim, double bal = 0);
    string getNumber();
    string getName();
    double getBalance();
    int getLimit();
    // Does the card have enough to buy something?
    bool chargelt(double price); 
  private:
    string number;
    string name;
    int limit;
    double balance;
}; 

```

I know there isn't much context here, but let's just say in the context of this being a introductory C++ course, what is likely asking me to do/learn? I'm really not sure what "implement the class methods" means here, and while it may be something that I've seen already, more than likely it's just an issue I have with not understanding it in plain English.

And I suppose it can also be asked that: If you were to teach an beginner student with this code, what would you expect them to do with it or learn from it?

Any insight would be greatly appreciated =)

Answer: 
Strictly speaking, the C++ language doesn't have "methods". It has "member functions", and perhaps that's the terminology that you're more familiar with. But many other languages do use the term "method", so it's actually fairly common for C++ programmers to say "methods" when what they're really talking about is member functions. 

The class definition shows that the class defines four member functions:

```
string getNumber();
string getName();
double getBalance();
int getLimit();

```

The definition also shows that there is a constructor:

```
CreditCard(string & no, string & nm, int lim, double bal = 0);

```

A constructor is also a type of member function, but most people don't refer to constructors as "methods". Some probably do, though.

So, the instruction "implement the class methods" means: "write the code for the member functions `getNumber()` `getName()` `getBalance()` and `getLimit()`."

It might also mean "and write the code for the constructor, `CreditCard(string & no, string & nm, int lim, double bal)`", too.
Think of the credit card as the real world object. And it will have the attributes of name,number,limit.
So, you have to do is set the values of these each in the constructor method, as because when we create a credit card we have these values assigned to them, like this

```
CreditCard::CreditCard(string & no, string & nm, int lim, double bal = 0)
{
   this->number = no; //you can also use number = no
   this->limit = lim;
   this->name = nm;
   this->balance = bal;
}

```

Now, as we have a credit card we may want to know the name of the card, so this can be implemented as follows:

```
string CreditCard::getName();
{
    return name;
}

```

The same way we can get the limits and number. I will leave that for you.