//Video 12 Code
//Today on the videos we're:
//Creating some classes. For aggregating data and data encapsulation
//To do this we're: attacking the practicals located at:
//http://shaunramsey.com/class/16SPRING/files/practical3.txt

//Person: id, name, birthday
//Shape: sides, name, perimeter, area
#include <iostream>
#include <string>
using namespace std;

class Person {
private:
  int id;
  string name;
  int month, day, year; //Date birthday;
public:
  Person() {
    id = -1;
    name = "Unknown";
    month = 1;  //birthday.set(1,1,1990);
    day = 1; 
    year = 1900;
  }
  //set the id of the person
  void setID(int i) {
    if (i >= 0) {
      id = i;
    }
  }

  //get the id of the person
  int getID() {
    return id;
  }

  void setBirthday(int m, int d, int y) {
    if (m >= 1 && m <= 12) {
      month = m;
    }
    if (d >= 1 && d <= 31) {
      day = d; 
    }
    year = y;
  }

  int getBirthMonth() {
    return month;
  }

};

class Shape {
private:
  int numberOfSides;
  string name;
  float perimeter;
  float area;
public:
  Shape(int ns, string n, float p, float a) {
    numberOfSides = ns;
    name = n;
    perimeter = p;
    area = a;
  }

  void output() {
    cout << "The Shape is a " << name << ". It has " << numberOfSides << " number of sides." << endl;
    cout << "It's area is " << area << " and its perimeter is " << perimeter << endl;
  }

};




int main() {
  Person mydad;
  mydad.setID(1);
  mydad.setBirthday(11, 30, 1920);
  cout << "Mydad's ID is : " << mydad.getID() << endl;
  cout << mydad.getBirthMonth() << endl;

  Shape myshape(0, "Circle", 6.28, 3.14);
  Shape mysquare(4, "Square", 4, 1);
  myshape.output();
  mysquare.output();
  //Shape myrect; doesn't work without a 0 parameter constructor

}
