public static void Main(string[] args) { string[] month = new string[12]{"Jan","Feb","Mar", "Apr", "may","Jun","Jul","Aug","Sep","Oct","Nov", "Dec"}; Double[] sales = new Double[12]; double sum = 0; Console.WriteLine("Enter the sales"); for(int i=0;i<month.Length;i++) { sales[i] = Convert.ToDouble(Console.ReadLine()); sum = sum + sales[i]; } Console.WriteLine("S.no \t Month \t Sales"); Console.WriteLine("-------------------------------"); for(int j=0;j<month.Length;j++) { Console.WriteLine("{0} \t {1} \t\t {2}",j, month[j], sales[j]); } Console.WriteLine("Maximum sales recorded is on {0}", sales.Max()); Console.WriteLine("Minimum sales recorded is on {0}", sales.Min()); Console.WriteLine("Average sales recorded is on {0}", (sum/month.Length)); }
public int getMaxConfidence(Double[] arrayOfConfidence) { double maxValue = arrayOfConfidence.Max(); int maxIndex = arrayOfConfidence.ToList().IndexOf(maxValue); return maxIndex; }
//Method that updates the chart with the data vectors public void ShowTrainingData(Double[][] classA, Double[][] classB) { //create data series from the vectors var class1 = AlgorithmHelpers.JaggedToMD(classA); var class2 = AlgorithmHelpers.JaggedToMD(classB); //Compute the minimum and maximum numbers for the X axis var maxX = classA.Max(0)[0] > classB.Max(0)[0] ? classA.Max(0)[0] : classB.Max(0)[0]; var minX = classA.Min(0)[0] < classB.Min(0)[0] ? classA.Min(0)[0] : classB.Min(0)[0]; //Update the range of the X axis with the max and the min perceChart.RangeX = new Range((float)minX, (float)maxX); nnChart.RangeX = new Range((float)minX, (float)maxX); lsChart.RangeX = new Range((float)minX, (float)maxX); //Update the Perceptron chart with the loaded data perceChart.UpdateDataSeries("class1", class1); perceChart.UpdateDataSeries("class2", class2); //Update the BackPropagation chart with the loaded data nnChart.UpdateDataSeries("class1", class1); nnChart.UpdateDataSeries("class2", class2); //Update the LS chart lsChart.UpdateDataSeries("class1", class1); lsChart.UpdateDataSeries("class2", class2); }