forked from hummel/PR1-Spreadsheet
Kleines Menü erstellt
parent
ada8f538a2
commit
49d70f71c3
|
@ -1,5 +1,5 @@
|
|||
package de.hs_mannheim.informatik.spreadsheet;
|
||||
|
||||
import java.util.Scanner;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,7 @@ import java.io.FileNotFoundException;
|
|||
public class Axel {
|
||||
|
||||
public static void main(String[] args) throws FileNotFoundException {
|
||||
Spreadsheet spr = new Spreadsheet(10,10);
|
||||
Spreadsheet spr = new Spreadsheet(10, 10);
|
||||
|
||||
spr.put("A3", "123");
|
||||
spr.put("A2", "1");
|
||||
|
@ -21,9 +21,38 @@ public class Axel {
|
|||
|
||||
System.out.println(spr);
|
||||
|
||||
spr.saveCsv("/tmp/test.csv");
|
||||
spr.saveCsv("C:\\Users\\sebas\\IdeaProjects\\PR1-Spreadsheet\\Axel\\resources\\zahlen.csv");
|
||||
|
||||
// TODO: You might want to put "UI loop" for entering value and formulas here resp. in some UI methods.
|
||||
System.out.println("Möchten Sie, die Tabelle bearbeiten (j/n)");
|
||||
Scanner sc = new Scanner(System.in);
|
||||
String eingabe = "";
|
||||
String eingabeCR = "";
|
||||
String eingabeValue = "";
|
||||
|
||||
|
||||
|
||||
do {
|
||||
eingabe = sc.nextLine();
|
||||
if (eingabe.equals("j")) {
|
||||
System.out.println("Geben Sie die Spalte (A-J) und die Zeile (1-10)");
|
||||
eingabeCR = sc.nextLine();
|
||||
System.out.println("Weisen Sie jetzt einen Wert zu");
|
||||
eingabeValue = sc.nextLine();
|
||||
spr.put(eingabeCR, eingabeValue);
|
||||
System.out.println();
|
||||
System.out.println(spr);
|
||||
System.out.println("Möchten Sie weiter machen(j/n)?");
|
||||
|
||||
} else if (eingabe.equals("n")) {
|
||||
System.out.println("Das Programm wird beendet");
|
||||
break;
|
||||
|
||||
} else {
|
||||
System.out.println("Falsche eingabe bitte erneut versuchen");
|
||||
}
|
||||
}while(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue