public void PrecipitationGivenDate()
        {
            /* User Input */
            string date = "9/21";

            /* Expected Output */
            string expectedOutput = $"\nThe predicted precipitation amount in the 27612 zipcode\nfor 9/21 is 0.135 units of precipitation.";

            /* Predicted Output */
            string predictedOutput = $"{PrecipitationOutput.Precipitation(date)}";

            /* Check to see if equal */
            Assert.AreEqual(expectedOutput, predictedOutput);
        }
        public void PrecipitationNoDate()
        {
            /* No Input */
            string date = "";

            /* Expected Output */
            string expectedOutput = $"\nThe predicted precipitation amount in the 27612 zipcode\nfor 9/25 is 0.56285714857143 units of precipitation.";

            /* Predicted Output */
            string predictedOutput = $"{PrecipitationOutput.Precipitation(date)}";

            /* Check to see if equal */
            Assert.AreEqual(expectedOutput, predictedOutput);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            /* Print introduction statement for app */
            Console.WriteLine("Welcome to the precipitation prediction app!\nLet's take a look at how much precipitation you will expect in the 27612 Zipcode.");

            /* Ask user to provide an input date for precipitation prediction */
            Console.WriteLine("\nWhat date would you like to examine precipitation for?\n(e.g. month/day input, such as 10/22 or 5/19): ");
            string date = Console.ReadLine();

            /* Take date input from user to find precipitation */
            string prediction = PrecipitationOutput.Precipitation(date);

            /* Provide output for precipitation on given date */
            Console.WriteLine(prediction);
        }