Complete the code to define a class named Car.
class [1] { public: int speed; };
The class name should be Car to match the definition.
Complete the code to declare a public integer member named 'age' inside the class.
class Person { public: [1] age; };
The member 'age' should be an integer, so use int.
Fix the error in the class definition by completing the missing keyword.
class Animal { [1]: int legs; };
To allow access to 'legs' from outside, the member should be public.
Fill both blanks to define a class with a private string member 'name' and a public integer member 'id'.
class Employee { [1]: std::string name; [2]: int id; };
The 'name' should be private and 'id' should be public for controlled access.
Fill all three blanks to define a class 'Book' with a private string 'title', a public integer 'pages', and a protected float 'price'.
class Book { [1]: std::string title; [2]: int pages; [3]: float price; };
The 'title' is private, 'pages' is public, and 'price' is protected to control access appropriately.