//Set 3 // To describe a WeatherRecord class WeatherRecord { Date d; TemperatureRange today; TemperatureRange normal; TemperatureRange record; WeatherRecord(Date d, TemperatureRange today, TemperatureRange normal, TemperatureRange record) { this.d = d; this.today = today; this.normal = normal; this.record = record; } //Determines whether today's range is within the normal range boolean withinRange() { if(this.today.low > this.normal.low && this.today.high < this.normal.high) return true; else return false; } //Determines whether precipitation is higher than normal today boolean rainyDay() { if(this.today.precip > this.normal.precip) return true; else return false; } //Determines whether either today's high or low pressure is a new record boolean recordDay() { if(this.today.high > this.record.high || this.today.low < this.record.low) return true; else return false; } } // To describe a date class Date { int day; int month; int year; Date(int day, int month, int year) { this.day = day; this.month = month; this.year = year; } //To advance to the next date Date nextDate(){ if(this.day == 30 && this.month == 12) return new Date(1,1,this.year + 1); else if(this.day == 30) return new Date(1, this.month + 1, this.year); else return new Date(this.day + 1, this.month, this.year); } } // To describe a Temperature Range class TemperatureRange { int high; int low; int precip; TemperatureRange(int high, int low, int precip) { this.high = high; this.low = low; this.precip = precip; } }