Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Look at the following class definition, which statements are legal and which are illegal. Explain why class Vehicals{ private: int sedan; int trucks; int planes;

Look at the following class definition, which statements are legal and which are illegal. Explain why

class Vehicals{

private:

int sedan;

int trucks;

int planes;

int boats;

publics:

Change() { sedans= trucks= planes= boats= 0; }

Change(int s, int t, int p, int b) { sedans= s ; trucks= t; planes= p; boats= b; }

void add(int s=0, int t=0, int p=0, int b=0)

{ sedans+= s; trucks += t; planes += p; boats+= b; }

void subtract(int s=0, int t=0, int b=0, int p=0)

{ sedans-= s; trucks -= t; planes -= p; boats-= b; }

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Did you connect with them?

Answered: 1 week ago

Question

My opinions/suggestions are valued.

Answered: 1 week ago