-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.cs
53 lines (40 loc) · 1.63 KB
/
cli.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
namespace Weather
{
//TODO: Implement C/F icon (add field in Weather class)
public class Cli
{
public static void printCurrent(Geolocation.Place place, Weather forecast)
{
string current = new string("");
current += $"Current weather in: {place.name}, {place.country}\n";
current += $"{forecast.weatherCurrent.main}, {forecast.weatherCurrent.temp} degrees";
Console.WriteLine(current);
}
//TODO: finish this monseter
public static void printDaily(Geolocation.Place place, Weather forecast)
{
string current = new string("");
current += $"Current weather in: {place.name}, {place.country}\n";
current += $"{forecast.weatherCurrent.main}, {forecast.weatherCurrent.temp} degrees";
string hourlyForecast = new string("");
foreach (var hour in forecast.weatherHourly.list)
{
hourlyForecast += $"{hour.datetime.ToString("HH:mm tt")}: {hour.temp} °C\n";
}
Console.WriteLine(current);
Console.WriteLine(hourlyForecast);
}
// TODO: implement weekly forecast
public static void printWeekly(Geolocation.Place place, Weather forecast)
{
string output = new string("TO IMPLEMENT");
Console.WriteLine(output);
}
// TODO: implement monthly forecast
public static void printMonthly(Geolocation.Place place, Weather forecast)
{
string output = new string("TO IMPLEMENT");
Console.WriteLine(output);
}
}
}