Complete the code to declare a class named Car.
class [1] { public: int speed; };
The class name should be Car to match the declaration.
Complete the code to create an object named myCar of class Car.
Car [1];The object name should be myCar as requested.
Fix the error in the code to access the speed attribute of myCar.
myCar.[1] = 100;
The attribute name is speed and accessed without parentheses.
Fill both blanks to define a constructor that sets speed to 0.
class Car { public: int speed; [1] [2] { speed = 0; } };
The constructor has the same name as the class Car() and uses braces {} for the body.
Fill all three blanks to create a method named accelerate that increases speed by 10.
class Car { public: int speed; void [1][2] [3] { speed += 10; } };
The method name is accelerate, followed by parentheses () and braces {} for the body.
