/* Filename: product1.cpp Author: Br. David Carlson Date: July 5, 1998 Revised: July 17, 2000 This file implements the Product class that was set up in product1.h. */ #include "product1.h" /* Given: InitialName A string containing the product name. InitialYear The year this product was made. InitialPrice The product's price. Task: This is the default constructor. It creates a new Product object containing the 3 items listed above. Return: Nothing is directly returned, but the object is created. */ Product::Product(ShortString InitialName, int InitialYear, float InitialPrice) { // Recall that you cannot simply assign one string into another. strcpy(Name, InitialName); Year = InitialYear; Price = InitialPrice; } /* Given: Nothing (other than the implicit object). Task: To print the data contained in this object. Return: Nothing. */ void Product::Print(void) const { cout << "Product name: " << Name << endl << "Year made: " << Year << endl << "Price: " << Price << endl << endl; }