Fill in public or private as appropriate to make the followi

Fill in \"public\" or \"private\" as appropriate to make the following statements true. By default, the members of a class are Often, classes have data members and function members. If the data members are, then there must be a constructor to initialize them. List the members you would include in the class definition of a class named BakingDishType. A cook wants to use objects in this class to represent baking dishes in her kitchen. When she buys a new dish, she wants to be able to enter an ID for it, three indicators to tell whether or not it can be used on the stovetop, in the oven, and in the microwave and the warranty expiration date (month and year). She wants to be able to see all the member variables\' values, to find oul where a dish can be used for cooking, and to find out the expiration date of the warranty. Write the definition of a constructor with parameters for the dateType class, which has variables for the day, month and year. The constructor should enforce data integrity: the day must be between 1 and 31, the month must be between 1 and 12, and the year must be greater than 0.

Solution

Answer1>

a>

By default, the members of a struct are public, while the members of a class are private.

b>

Often, classes have private data members and public member functions.

c>

If the data of a class are public, then there must be public constructor to initialize it.

 Fill in \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site