Fix header so it can be run in the main: Main: #include <vector> #include \"Aqua
ID: 3903835 • Letter: F
Question
Fix header so it can be run in the main:
Main:
#include <vector>
#include "Aquarium.h"
using namespace std;
// We would like to use the Aquarium object which has been
// defined in "Aquarium.h". If we compile the program, we will
// find that it is unable to link the project because it cannot find
// the definition of the functions for Aquarium.
// OBJECTIVE: Get this code to compile by providing the missing function
// definitions for the Aquarium object.
int main()
{
Aquarium a{ Size{12.0, 12.0}, 15 };
}
Header:
#include "Aquarium.h"
class Aquarium
{
public:
Aquarium();
};
Explanation / Answer
struct Size{ int x; int y; }; class Aquarium { public: Size size; int iVal; Aquarium(); Aquarium(Size s, int i){ size = s; iVal = i; } };
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.