From c059a4289a145abbefc5a4a90a80b0db7325994a Mon Sep 17 00:00:00 2001 From: selim Date: Tue, 26 Dec 2023 05:40:50 +0100 Subject: [PATCH] Spreadsheet standardDeviation start of implementation. --- .../informatik/spreadsheet/Spreadsheet.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index a606258..eae19ed 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -54,6 +54,10 @@ public class Spreadsheet { return get(getRow(cellName), getCol(cellName)); } + public String getCellName(int row, int col) { + return "" + ((char) ('A' + col)) + (row+1); + } + private void put(int row, int col, String value) { if (!value.startsWith("=")) cells[row][col].setValue(value); @@ -248,6 +252,21 @@ public class Spreadsheet { result /= counter; return result; } + private double standardDeviation(String startCellName, String endCellName){ + ArrayList cellNames = new ArrayList<>(); + + long avg = 0; + int counter = 0; + for(int r = getRow(startCellName); r