So my project requires me to create a header file that defines the following class and its members/functions:
#include <string>
using namespace std;
class Ticket
{
public:
string mName;
string mFromCity;
string mToCity;
double mCost;
Ticket(string name, string fromCity, string toCity, double cost)
{
string getName();
string getFromCity();
string getToCity();
double getCost();
void setName(string name);
void setFromCity(string fromCity);
void setToCity(string toCity);
void setCost(double cost);
}
};
The instructions said to copy the member and function names letter for letter but why is it that a bunch of the names for functions and members aren't consistent such as "mName", "name", and just "Name" later on? Furthermore the instructions had the declarations down in the form of "mName : string" (which generates errors) instead of just "string mName" like I did...