37 lines
965 B
C++

#include "WaterIntake.h"
#include <iostream>
WaterIntake::WaterIntake() : day(0), month(0), year(0), quantity(0.0) {}
WaterIntake::WaterIntake(unsigned int day, unsigned int month, unsigned int year, float quantity) : day(day), month(month), year(year), quantity(quantity) {
}
WaterIntake::~WaterIntake() {}
unsigned int WaterIntake::getDay() {
return day;
}
unsigned int WaterIntake::getMonth() {
return month;
}
unsigned int WaterIntake::getYear() {
return year;
}
float WaterIntake::getQuantity() {
return quantity;
}
std::string WaterIntake::toString() {
return "day: " + std::to_string(day) + "\n month: " + std::to_string(month) + "\n year: " + std::to_string(year) + "\n quantity: " + std::to_string(quantity) + "\n";
}
void WaterIntake::addQuantity(float addQuantity) {
quantity = quantity + addQuantity;
}
bool WaterIntake::isNormal() {
return 2.0 <= quantity && quantity <= 2.5;
}