Solution: Weather Log Writer

Review how to encode strings to byte arrays and write them safely to a file using a modern using declaration.

Solution: Weather Log Writer

Review how to encode strings to byte arrays and write them safely to a file using a modern using declaration.
C# 14.0
using System.IO;
using CodingExercise;
string temperatures = "22.5, 24.1, 21.8, 19.5, 23.0";
string logFile = "weather_log.txt";
WeatherUtility.SaveTemperatures(temperatures, logFile);
string savedData = File.ReadAllText(logFile);
Console.WriteLine($"Verified file contents: {savedData}");