using System.Numerics; internal class Program { private static void Main(string[] args) { //declares variables int Input; int TotalRainFall = 0; int AverageRainFall = 0; Boolean RainfallT = false; int[] RainFall = new int[5];//creates a string array for (int i = 0; i < 5; i++)//creates a for loop until 3 variables are in the array { int z = i + 1 ;//adds the corresponding number after the measurement for measurement 1, 2 ,3 etc do { Console.WriteLine("Please enter measurement " + z);//asks the user for an input for measurement Input = Convert.ToInt32(Console.ReadLine());//converts the input from user to the variable input if (Input < 1)// checks if input was below 1 { Console.WriteLine("Please enter a number above 1");//tells the user to enter a valid number } else { RainfallT = true;//sets RainFallT to ture RainFall[i] = Input;//sets current rainfall to input } } while (RainfallT = false);//ends do statement when } for (int x = 0; x < 5; x++)//used to reiterate 5 times { int z = x + 1 ;//used to count days Console.WriteLine("Rainfall for day " + z + " was " + RainFall[x]);//outputs each day of rainfall user entered TotalRainFall = TotalRainFall + RainFall[x];//adds all rainfalls together to get total AverageRainFall = TotalRainFall / 5;//divides total rainfall by 5 to get average } Console.WriteLine("The total amount of rainfall was " + TotalRainFall);//tells the user the total amount of rainfall Console.WriteLine("The average rainfall through the 5 days was " + AverageRainFall);//tells the user the average rainfall Console.ReadKey();//to end the program } }