1
0
Fork 0
PR1-Spreadsheet/Axel/src/de/hs_mannheim/informatik/spreadsheet/Axel.java

60 lines
2.4 KiB
Java

package de.hs_mannheim.informatik.spreadsheet;
import java.io.FileNotFoundException;
import java.util.InputMismatchException;
import java.util.Scanner;
/**
* Part of a simplified spreadsheet system for the PR1 programming lab at Hochschule Mannheim.
*
* @author Oliver Hummel, Selim Eser (2211482)
*/
public class Axel {
public static void main(String[] args) throws FileNotFoundException {
Spreadsheet spr = new Spreadsheet(10,10);
boolean match = false;
boolean stop = false;
Scanner sc = new Scanner(System.in);
System.out.println("\nAxel(ExcelFakeVon2211482): ");
while (!match) {
try {
System.out.print("\nTabellengröße(ReihenZwischen1-99 SpaltenZwischen1-26): ");
spr = new Spreadsheet(sc.nextInt(), sc.nextInt());
match = true;
} catch(InputMismatchException i){
System.out.println("\nGeben Sie zwei Ganzzahlen mit Leerzeichen dazwischen an!");
System.out.println("\nEnter zum fortfahren.");
sc.nextLine();
sc.nextLine();
}
}
while (!stop) {
try {
spr.updateSpreadsheet();
System.out.println(spr);
System.out.println("\nHILFE (Für eine Anleitung.)\n");
System.out.print("KOMMANDO: ");
stop = spr.cellInput();
} catch(Exception e){
System.out.println("\nEingabe unzulässig!");
System.out.println("\nEnter zum fortfahren.");
sc.nextLine();
sc.nextLine();
}
}
}
public static void help(){
System.out.println("\nEinlesen: \nKOMMANDO Dateipfad Trennzeichen StartzelleObenLinks (Alles mit Leerzeichen getrennt.) e.g.:\nEINLESEN Axel/resources/zahlen.csv , A1");
System.out.println("\nSpeichern: \nKOMMANDO Dateipfad (Mit Leerzeichen getrennt.) e.g.:\nSPEICHERN Axel/resources/zahlen.csv");
System.out.println("\nFormel Tabellenansicht: \nKOMMANDO e.g.:\nFORMELN");
System.out.println("\nZellen Werte/Formeln zuweisen: \nZELLE ZUWEISUNG (Mit Leerzeichen getrennt, Zelle beginnend mit Buchstabe und Zuweisung beginnend mit =; Keine Kommazahlen als Eingabe erlaubt.) e.g.:\nA1 =A5+15\n" +
"\nZellen Werte/Formeln löschen: \nZELLE ZUWEISUNG (Mit Leerzeichen getrennt, Zelle beginnend mit Buchstabe und Zuweisung nur =) e.g.:\nA1 =\n" +
"\nZELLE FORMELZUWEISUNG (Formelzuweisung mit Startzelle bis Endzelle getrennt durch :.) e.g.:" +
"\nA2 =SUMME(A1:H10)\t\tA3 =PRODUKT(A1:H10)\t\tA4 =MITTELWERT(A1:H10)\t\tA5 =STABW(A1:H10) (Standartabweichung)\t\tA6 =MIN(A1:H10)\t\tA7 =MAX(A1:H10)");
}
}