[solved] – Question 93987
Suppose your program contains the following class definition:
class Automobile
{
public:
void set_price(double new_price);
void set_profit(double new_profit);
double get_price();
private:
double price;
double profit;
double get_profit();
};
and suppose the main part of your program contains the following declaration
and that the program sets the values of all the member variables by taking input
from the user:
Automobile hyundai, jaguar;
hyundai.price = 4999.99;
jaguar.set_price(30000.97);
double a_price, a_profit;
a_price = jaguar.get_price();
a_profit = jaguar.get_profit();
a_profit = hyundai.get_profit();
if (hyundai == jaguar)
cout << “Want to swap cars?”;
hyundai = jaguar;
Which of the following statements are then allowed in the main part of your
Program?
1. Firstly make all members public
2. Make all members private
3. Make data members public and functional member private
4. Make data members private and functional members public
Expert Answer
OR

