Pay no attention to main yet. I am working on the class errors first.
Code:
#include<iostream>
#include<string>
//#include<cassert>
using namespace std;
/*1a.*/
class Date
{
int day;
int month;
int year;
public:
Date (int Day=1, int Month=1, int Year=1970)
{
day = Day;
month = Month;
year = Year;
}
int getDay() {return day;}
int getMonth() {return month;}
int getYear() {return year;}
};
/*1b. InventoryItem containing Name, Cost, Quantity, DatePurchased(Object of the date Class), InventoryTotal(Static Variable)*/
class InventoryItem
{
string Name;
double Cost;
int Quantity;
Date DatePurchased; /*Object of the date class*/
static int InventoryTotal(100);
public:
/* InventoryItem (string strName, double dCost, int nQuantity, Date cDatePurchased(int, int, int), int s_nInventoryTotal)
{
Name = strName;
Cost = dCost;
Quantity = nQuantity;
DatePurchased = cDatePurchased;
InventoryTotal = s_nInventoryTotal;
} */
InventoryItem() : Name("Nobody"), Cost(0.0), Quantity(0), DatePurchased(1,1,1970) { }
string getName() {return Name;}
double getCost() {return Cost;}
int getQuantity() {return Quantity;}
string getDatePurchased() {return DatePurchased;}
int getInventoryTotal() {return InventoryTotal;}
friend void changeQuantity(int) { cin>> int Quantity ;}
};
int main ()
{
InventoryItem testit;
cout<<testit.InventoryTotal;
}