Line 4 contains the default constructor for the class.
Yes. The data members are allowed for direct access in main, since they are public and also accessible by member functions. So they will work.
Const means that this function is not permitted to modify the object on which it is called.
What is Constructor?
A constructor is a special method of a class or structure that initializes a newly created object of that type in object-oriented programming.The constructor is automatically get invoked whenever the object is created.
A constructor is similar to an instance method in that it has the same name as the class and can be used to set the values of an object's members to default or user-defined values. However, despite its resemblance, a constructor is not a proper method because it lacks a return type. The constructor initializes the object rather than performing a task by executing code, and it cannot be static, final, abstract, or synchronized.
To learn more about Constructor, visit: https://brainly.com/question/27727622
#SPJ4