diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java index df720b3..078d0f8 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java @@ -1,6 +1,7 @@ package de.hs_mannheim.informatik.spreadsheet; import java.io.FileNotFoundException; +import java.util.Scanner; /** * Part of a simplified spreadsheet system for the PR1 programming lab at Hochschule Mannheim. @@ -11,7 +12,8 @@ public class Axel { public static void main(String[] args) throws FileNotFoundException { Spreadsheet spr = new Spreadsheet(10,10); - + Scanner keyboard = new Scanner(System.in); + spr.put("A3", "123"); spr.put("A2", "1"); @@ -20,8 +22,26 @@ public class Axel { spr.put("J6", "=3/2"); System.out.println(spr); - - spr.saveCsv("/tmp/test.csv"); + + while(true){ + System.out.println("Please enter the cell name: "); + String cellName = keyboard.nextLine(); + + System.out.println("Please enter your value or your formula: "); + String cellValue = keyboard.nextLine(); + + spr.put(cellName, cellValue); + + System.out.println(spr); + + System.out.println("Do you want to end the program? Y/N"); + if(keyboard.nextLine().equalsIgnoreCase("Y")){ + break; + } + + } + + spr.saveCsv("C:/Users/kisne/IdeaProjects/PR1-Spreadsheet/tmp/test.csv"); // TODO: You might want to put "UI loop" for entering value and formulas here resp. in some UI methods. }