Private/Public Classes, explanation please in context
I'm making a car sale program, and we are asked to have many different components in the calculation of the final price. the public stuff make sense, but can someone explain to me when I should use the private variables and how I should use them and why I should use them. it doesn't really make sense, and we really wern't given an explanation. Thank you very much. Here's a snippet of my code to help you. Could someone give me an example of the cost function that is in the private class, and how I can get it from the user? Thanks again!!!
Code:
class Cars
{
public:
string get_color();
string get_make();
int get_year();
int number_of_speeds();
double cost_car();
void set(int the_year, string the_color, int the_speeds);
private:
int speeds;
string color;
string make;
int cost;
};