Answered step by step
Verified Expert Solution
Question
1 Approved Answer
object oriented c++ Each of the class declarations and/or member function definitions below has syntax error(s). Find every error with explanation. Hint: You may use
object oriented c++
Each of the class declarations and/or member function definitions below has syntax error(s).
Find every error with explanation.
Hint: You may use compiler to help you find the error. However, you need to set up the program correctly and to point out the true cause of the syntax error. Because the compiler messages are convoluted, due to the convoluted nature of language dependencies.
1) class Truck, public : Vehicle, protected { private: double cargoWeight; public: Truck(); ~Truck(); };
2) class SnowMobile : Vehicle { protected: int horsePower; double weight; public: SnowMobile(int h, double w), Vehicle(h) { horsePower = h; } ~SnowMobile(); };
3) class Table : public Furniture { protected: int numSeats; public: Table(int n) : Furniture(numSeats) { numSeats = n; } ~Table(); };
4) class Tank : public Cylinder { private: int fuelType; double gallons; public: Tank(); ~Tank(); void setContents(double); void setContents(double);
5) class Three : public Two : public One { protected: int x; public: Three(int a, int b, int c), Two(b), Three(c) { x = a; } ~Three(); };
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started