21. The following implementation is accepted bycompiler:
class Automobile
{
public:
void SetPrice(double newPrice);
void SetProfit(double newProfit);
double GetPrice();
private:
double price;
double profit;
double GetProfit();
};
int main()
{
Automobile hyundai;
hyundai.price={ 4999.99 };
)
T__ F__
22. The following implementation is syntactically correct:
class Building
{
public:
int x;
};
int main()
{
Building c;
cout << “x = ” << c.x << endl;
}
T__ F__
23. The following implementation is not accepted bycompiler:
class myClass
{
private:
int x;
public:
int y;
myClass(){x = {}; y = {};}
};
int main()
{
myClass numberOne = myClass();
}
T__ F__
24. The following implementation is not accepted by compiler:
class Change {
private:
int pennies; int nickels; int dimes; intquarters;
Change()
{
PayPal Gateway not configured
PayPal Gateway not configured