-
Notifications
You must be signed in to change notification settings - Fork 1
/
WeatherReport.cs
32 lines (28 loc) · 1.08 KB
/
WeatherReport.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
using System;
namespace WeatherMicroservice {
#region WeatherReport
public class WeatherReport {
private static readonly string[] PossibleConditions = {
"Sunny",
"Mostly Sunny",
"Partly Sunny",
"Partly Cloudy",
"Mostly Cloudy",
"Rain"
};
#region WeatherReportConstructor
public WeatherReport (double latitude, double longitude, int daysInFuture) {
var generator = new Random ((int) (latitude + longitude) + daysInFuture);
HighTemperatureFahrenheit = generator.Next (40, 100);
LowTemperatureFahrenheit = generator.Next (0, HighTemperatureFahrenheit);
AverageWindSpeedMph = generator.Next (0, 45);
Condition = PossibleConditions[generator.Next (0, PossibleConditions.Length - 1)];
}
#endregion
public int HighTemperatureFahrenheit { get; }
public int LowTemperatureFahrenheit { get; }
public int AverageWindSpeedMph { get; }
public string Condition { get; }
}
#endregion
}