Answer to Question #93987 in C++ for Junaid Khan

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
1
Expert's answer
2019-09-07T07:04:28-0400
Dear Junaid Khan, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS