Tracks
/
Go
Go
/
Exercises
/
Weather Forecast
Weather Forecast

Weather Forecast

Learning Exercise

While completing Weather Forecast, you'll learn 1 concept

Instructions

Goblinocus is a country that takes its weather forecast very seriously. Since you are a renowned responsible and proficient developer, they asked you to write a program that can forecast the current weather condition of various cities in Goblinocus. You were busy at the time and asked one of your friends to do the job instead. After a while, the president of Goblinocus contacted you and said they do not understand your friend's code. When you check the code, you discover that your friend did not act as a responsible programmer and there are no comments in the code. You feel obligated to clarify the program so goblins can understand them as well.

1. Document package weather

Since goblins are not as smart as you are, they forgot what the package should do for them. Please write a comment for package weather that describes its contents. The package comment should introduce the package and provide information relevant to the package as a whole.

2. Document the CurrentCondition and CurrentLocation variables

The president of Goblinocus is a bit paranoid and fears uncommented variables are used to destroy their country. Please clarify the usage of the package variables CurrentCondition and CurrentLocation and put the president's mind at ease. This should tell any user of the package what information the variables store, and what they can do with it.

3. Document the Forecast() function

Goblinocus forecast operators want to know what the Forecast() function does (but do not tell them how it works, since unfortunately, they will get more confused). Please write a comment for this function that describes what the function does, but not how it does it.

Last updated 4 December 2022
Edit via GitHub The link opens in a new window or tab
Go Exercism

Ready to start Weather Forecast?

Sign up to Exercism to learn and master Go with 34 concepts, 136 exercises, and real human mentoring, all for free.