+ 1

cannot implicitly convert type double to double

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Simple_Spreadsheet { class Median { private double[] columnA = new double[5], median; public Median(double[] columnA) { this.columnA[0] = columnA[0]; this.columnA[1] = columnA[1]; this.columnA[2] = columnA[2]; this.columnA[3] = columnA[3]; this.columnA[4] = columnA[4]; } public void setA1(double[] columnA) { this.columnA[0] = columnA[0]; } public double getA1() { return columnA[0]; } public void setA2(double[] columnA) { this.columnA[1] = columnA[1]; } public double getA2() { return columnA[1]; } public void setA3(double[] columnA) { this.columnA[2] = columnA[2]; } public double getA3() { return columnA[2]; } public void setA4(double[] columnA) { this.columnA[3] = columnA[3]; } public double getA4() { return columnA[3]; } public void setA5(double[] columnA) { this.columnA[4] = columnA[4]; } public double getA5() { return columnA[4]; } public double calcMedian(double[] columnA) { this.columnA[0] = columnA[0]; this.columnA[1] = columnA[1]; this.columnA[2] = columnA[2]; this.columnA[3] = columnA[3]; this.columnA[4] = columnA[4]; Array.Sort(columnA); median = columnA[2] ; return median; } }

11th Aug 2019, 12:33 PM
Marianne James
Marianne James - avatar
2 Antworten
0
im trying to calculate the median can someone please help?
11th Aug 2019, 12:34 PM
Marianne James
Marianne James - avatar
0
Can you show this code in the playground. I like to see sample data and how to call this method ?
12th Aug 2019, 8:18 PM
sneeze
sneeze - avatar