double ParkingCard::getTotalExpenses()const
{
MyTime ex=leavingTime-parkingTime;
if(ex.getMinue()<30)
{
return (ex.getHour()+0.5)*rate;
}
else
return (ex.getHour()+1)*rate;
}
ostream&operator<<(ostream& out,const ParkingCard& t)
{
out<<"ParkingTime:"<<t.parkingTime;
out<<"LeavingTime:"<<t.leavingTime;
out<<"Rate:"<<t.rate;
return out;
}