namespace HurricaneObject;
public static class Program
{
private static void Main()
{
var hurricanes = new List<Hurricane>
{
new("Katrina", "Atlantic", 2005, 174, 5, new DateTime(2005, 08, 23), new DateTime(2005, 08, 31)),
new("Ian", "Atlantic", 2022, 155, 5, new DateTime(2022, 09, 23), new DateTime(2022, 10, 02))
};
foreach (var hurricane in hurricanes)
{
Console.WriteLine($"Name: {hurricane.Name}");
Console.WriteLine($"Basin: {hurricane.Basin}");
Console.WriteLine($"Year: {hurricane.Year}");
Console.WriteLine($"Maximum Speed: {hurricane.MaximumSpeed}");
Console.WriteLine($"Maximum Category: {hurricane.MaximumCategory}");
Console.WriteLine($"Start Date: {hurricane.StartDate}");
Console.WriteLine($"End Date: {hurricane.EndDate}\n");
}
Console.ReadKey();
}
}
internal class Hurricane
{
public string Name { get; }
public string Basin { get; }
public int Year { get; }
public int MaximumSpeed { get; }
public int MaximumCategory { get; }
public DateTime StartDate { get; }
public DateTime EndDate { get; }
public Hurricane(string name, string basin, int year, int maximumSpeed, int maximumCategory, DateTime startDate, DateTime endDate)
{
Name = name;
Basin = basin;
Year = year;
MaximumSpeed = maximumSpeed;
MaximumCategory = maximumCategory;
StartDate = startDate;
EndDate = endDate;
}
}