The reason for changing the class name to ItemInfo will be given later.
A class definition encapsulates a class's methods and instance variables.
class ItemInfo {
// Here are the methods:
double getPrice() { return price; }
string getColor() { return color; }
// Here are the instance variables:
double price;
string color;
}; // note the semicolon!
|