For this question you will implement the writeAquariumContents member method. This method should:
Accept one parameter:
string: The filepath for the output to be saved.
This function should write a list of the Fish currently in the Aquarium to the file specified by the filepath.
This method should output the following to the specified txt file:
If there are no Fish in the Aquarium, the function should write There are no fish in 's Aquarium..
Otherwise, the function should write 's Aquarium ( of gallons of water used): on the first line, followed by the Fish name and gallons required, one per line.
This function should return one of the following bool values:
true if the aquarium's contents were written to the file successfully (regardless of whether or not there are any fish in the aquarium).
false if the file could not be opened.
Example 1: Multiple Fish in the Aquarium.
//create an aquarium object
Aquarium billys_aquarium("Billy");
//load fish from file
billys_aquarium.loadFish("fish_example.txt");
//add some fish
billys_aquarium.addFish("platinum ogon koi");
billys_aquarium.addFish("eLePhAnt EaR bEtTa");
billys_aquarium.addFish("Blue Peacock Cichlid");
billys_aquarium.writeAquariumContents("billysAquarium.txt");
Expected contents of billysAquarium.txt:
Billy's Aquarium (11 of 12 gallons of water used):
Platinum Ogon Koi - 5
Elephant Ear Betta - 3
Blue Peacock Cichlid - 3
Example 2: The Aquarium is empty (no fish).
//create aquarium object
Aquarium billys_aquarium("Billy");
//save aquarium contents
billys_aquarium.writeAquariumContents("billysAquarium.txt");
Expected contents of billysAquarium.txt:
There are no fish in Billy's Aquarium.