Created
December 9, 2022 12:40
-
-
Save Mishco/1e52e054b50f270dea8fe2baaa00bb33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class WeatherTracker { | |
| public String currentConditions; | |
| private Phone phone; | |
| private Emailer emailer; | |
| public WeatherTracker() { | |
| phone = new Phone(); | |
| emailer = new Emailer(); | |
| } | |
| public void setCurrentConditions(String weatherDescription) { | |
| this.currentConditions = weatherDescription; | |
| if (weatherDescription == "rainy") { | |
| String alert = phone.generateWeatherAlert(weatherDescription); | |
| System.out.print(alert); | |
| } | |
| if (weatherDescription == "sunny") { | |
| String alert = emailer.generateWeatherAlert(weatherDescription); | |
| System.out.print(alert); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment