1
0
Fork 0

UI Loop hinzugefügt. Values können ins Spreadsheet hinzugefügt werden + Path erstellt

main
Anastasia Kisner 2023-12-28 00:35:11 +01:00
parent c6ce44dac8
commit df3bb6b59b
1 changed files with 23 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package de.hs_mannheim.informatik.spreadsheet; package de.hs_mannheim.informatik.spreadsheet;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.util.Scanner;
/** /**
* Part of a simplified spreadsheet system for the PR1 programming lab at Hochschule Mannheim. * Part of a simplified spreadsheet system for the PR1 programming lab at Hochschule Mannheim.
@ -11,6 +12,7 @@ public class Axel {
public static void main(String[] args) throws FileNotFoundException { public static void main(String[] args) throws FileNotFoundException {
Spreadsheet spr = new Spreadsheet(10,10); Spreadsheet spr = new Spreadsheet(10,10);
Scanner keyboard = new Scanner(System.in);
spr.put("A3", "123"); spr.put("A3", "123");
spr.put("A2", "1"); spr.put("A2", "1");
@ -21,7 +23,25 @@ public class Axel {
System.out.println(spr); 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. // TODO: You might want to put "UI loop" for entering value and formulas here resp. in some UI methods.
} }