Question: The following code segment will be used for the next block of questions. The code in the class Sea is complete, and the main Program


The following code segment will be used for the next block of questions. The code in the class Sea is complete, and the main Program contains only a partially completed main program (in other words there are no additional functions, but there could be more code in the main function). Also some of these questions may have more than one correct answer listed - you should mark ALL that apply in these cases (4 points each unless otherwise indicated): class Sea { public: Sea(); void sail (double n); int riddle(); private: double wind = 0.0; int water; }; int main() { Sea my Sea; Sea *yourSea = new Sea(mySea); // // The rest of the code follows from this point } Sea:: Sea() { water = 1; } void Sea:: sail (double n) { wind = n; } int Sea::riddle() { return water; } Question 18 4 pts In the code above, what would be a correct way for the main Program to invoke the function riddle? None of the these options are correct int x = mySea.riddle(); int x = Sea.riddle(); O int x = riddle()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
