Customer - #include"stdstuff.h#include"Customer.h Your...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include "stdstuff.h" #include "Customer.h" # // Your method implementations go here. // the constructor creates a customer with id 10, total 0, date 1 1 2011 and name "default" Customer::Customer() { id = 10; total = 0; purchDate = Date(1,1,2011); custName = "default"; } Customer::Customer(int id, double total, const Date &purchase, const String2002 if (id<1||id>1000||total<0||purchase.compareTo(1,1,2000)==-1|| purchase.compareTo(12,31,2015)==1||name.length()<1 || name.length()>20){ *this = student(); quit("Customer::Customer - invalid Customer.\n"); } Customer::id=id; Customer::total=total; Customer::purchase=purchase; Customer::name=name; } int Customer::getID () const{ return id; } double Customer::getTotal () const{ return total; } Date Customer::getDate () const{ return purcjase; } String2002 Customer::getName () const{ return name; } void Customer::print() const{ cout << setiosflags(ios::fixed|ios::showpoint); cout << setprecision(2); // to get 2 decimal places for total
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/13/2011 for the course SYSC 2002 taught by Professor Unknown during the Spring '07 term at Carleton.

Page1 / 2

Customer - #include"stdstuff.h#include"Customer.h Your...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online