From 98026d2e20ffc162ebab1d8cb9a1485dc61a14f5 Mon Sep 17 00:00:00 2001 From: "Dr.Janson" Date: Sat, 6 Jan 2024 15:24:05 +0100 Subject: [PATCH] Spreadsheet loop bis man stop schreibt --- .../informatik/spreadsheet/Axel.java | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java index df720b3..7de087e 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,6 +12,8 @@ public class Axel { public static void main(String[] args) throws FileNotFoundException { Spreadsheet spr = new Spreadsheet(10,10); + @SuppressWarnings("resource") + Scanner input = new Scanner(System.in); spr.put("A3", "123"); spr.put("A2", "1"); @@ -19,9 +22,27 @@ public class Axel { spr.put("J5", "=7*6"); spr.put("J6", "=3/2"); - System.out.println(spr); + System.out.println("Schreibe 'stop' zum anhalten."); + do{ + String command = ""; + String form = ""; + String cell= ""; + System.out.println(spr); + System.out.println("Befehl (z.B. D4_=7*6): "); + command = input.nextLine(); + if(command.contentEquals("stop")) + break; + for(int i = 3; i