HW 9aDog class-Ovorload operators Projost: HW 9a 2 filos 1) File: Dog.h o Includo a class specification for a Dog class o Data membors - name (string) - weight (loat) age (int) o 3 Public methods Note: No Dog.cpp file. Includo the function implementations in the class specification.) Constructor 3arguments: (string, float, int) The values passed from main0 are assigned to an object's data members: name, weight, and age, respectively - Destructor (Does nothing) displayDog No arguments are passed to the function. The function is void-returning . The displayDog function displays the following output: NAME: Jack WEIGHT: 4.5 pounds AGE: 3 years old. 2.) File: main.cpp - In main0, declare two Dog objects: myDog and yourDog . At the time the objects are declared, assign include the following values for each Dog object, so that the values can be passed to the constructor. myDog name: Spot weight: 5.5
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here