Question:
C# Programming
A single class application that allows user to inout monthly rainfall amounts for one year storing the values in an array. Produce a report showing the month name along with the rainfall amount and its variance from the mean. Calculate the average rainfall for the year.
Here is some code that I was playing around with and attempting to alter. Ive gotten stuck every time I try to change the code. I now have more errors than I know how to fix.
using System;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace assignment
{
class program
{
static int monthRainfall;
static string[] month;
static void Main(string[] args)
{
int[] array = new int[12];
Console.Write("This program allow intu of rainfall for one year. A table displayed showing the month with rainfall for that month and variance from the mean. Calculate total rainfall for year. ");
Console.Write("Please enter the rainfall for " + month + " : ");
for (int i = 0; i < 12; i++)
{
array[i] = int.Parse(Console.ReadLine());
Console.WriteLine(array[i]);
}
Console.Read();
int sum = 0;
for (int i = 0; i < 12; i++)
{
sum = sum + array[i];
}
int mean = sum / 12;
////////////////////Unsure if the code above works. Ive confused myself at this point.
Console.WriteLine("Month " + "Rainfall" + "Variance from Mean");
Console.WriteLine("January: " +);
Console.WriteLine("February: "
Console.WriteLine("March: "
Console.WriteLine("April: " ...........................................
////////////////////////////////////////Unsure how to make the program display the months with the totals and variance.//////////////
}
}
DATE
Question answered on Jul 22, 2018
PRICE: $20
Solution~000447558.zip (18.37 KB)