C++
For this question, you will create three methods for the Aquarium class. The function specifications are listed below:
The Aquarium constructor
This constructor will accept one string parameter for the aquarist's name, and set gallons_used to 0.
Accept one parameter:
string: The name of the aquarist. The data member aquarist_name should be set to this parameter.
Set the gallons_used data member to 0.
The getAquaristName method
This method should accept no parameters and returns the aquarist_name data member.
Accept no parameters.
This function returns the aquarist_name data member as a string.
The getGallonsUsed method
This method accepts no parameters and returns the gallons_used data member.
Accept no parameters.
This function returns the gallons_used data member as an int.
Example Usage
//create an aquarium object
Aquarium billys_aquarium("Billy");
//test getAquaristName method
cout << billys_aquarium.getAquaristName() << endl;
//test getGallonsUsed method
cout << billys_aquarium.getGallonsUsed() << endl;
Expected output:
Billy
0
Expert Answer C ++ program clas