102 lines
2.9 KiB
Java
102 lines
2.9 KiB
Java
|
import java.io.FileWriter;
|
||
|
import java.io.IOException;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Scanner;
|
||
|
|
||
|
public class Terminplaner {
|
||
|
|
||
|
public static void main(String[] args) throws IOException {
|
||
|
System.out.println(gruss("User"));
|
||
|
|
||
|
Scanner input = new Scanner(System.in);
|
||
|
|
||
|
ArrayList<String> bdays = new ArrayList<String>();
|
||
|
|
||
|
bdays.add("Geburstage:");
|
||
|
bdays.add("31.01.1992 - Cousin");
|
||
|
bdays.add("13.06.1970 - Papa");
|
||
|
bdays.add("21.09.1972 - Mama");
|
||
|
bdays.add("30.08.2004 - Schwester1");
|
||
|
bdays.add("07.07.2001 - Bruder");
|
||
|
bdays.add("03.04.1945 - Oma");
|
||
|
bdays.add("19.08.1942 - Opa");
|
||
|
bdays.add("22.10.2000 - Freundin");
|
||
|
bdays.add("23.11.2001 - Freund");
|
||
|
bdays.add("15.02.2006 - Schwester2");
|
||
|
bdays.add("25.12.1984 - Tante");
|
||
|
|
||
|
// Anzahl der Termine (Array)
|
||
|
String[] termine = new String[5];
|
||
|
for (int i = 1; i < 5; i++) { // Schelife
|
||
|
termine[i] = "";
|
||
|
|
||
|
boolean fertig = false;
|
||
|
while (!fertig) {
|
||
|
|
||
|
System.out.println("\n-------------\nTerminplaner:");
|
||
|
System.out.println("-------------");
|
||
|
|
||
|
System.out.println("\n1 = Neuen Termin eintragen");
|
||
|
System.out.println("2 = Termin bearbeiten");
|
||
|
System.out.println("3 = Geburtstagsliste aufrufen");
|
||
|
System.out.println("4 = sonstige Notizen");
|
||
|
System.out.println("5 = Programm beenden \n");
|
||
|
System.out.println("-------------");
|
||
|
|
||
|
String s = null;
|
||
|
s = input.nextLine();
|
||
|
|
||
|
if (s.equals("1")) {
|
||
|
System.out.println("1.Terminbeschreibung:");
|
||
|
String a = input.nextLine();
|
||
|
System.out.println("2. Datum:");
|
||
|
String b = input.nextLine();
|
||
|
System.out.println("3.Uhrzeit:");
|
||
|
String c = input.nextLine();
|
||
|
System.out.printf("%d. Ihr " + a + " am " + b + " um " + c + " Uhr wurde eingetragen! ", i++);
|
||
|
|
||
|
}
|
||
|
|
||
|
else if (s.equals("2")) {
|
||
|
System.out.println("2.Termin bearbeiten:");
|
||
|
System.out.println("Termin neu eintragen!");
|
||
|
System.out.println("-------------");
|
||
|
System.out.println("1.Terminbeschreibung:");
|
||
|
String aa = input.nextLine();
|
||
|
System.out.println("2.Datum:");
|
||
|
String bb = input.nextLine();
|
||
|
System.out.println("3.Uhrzeit:");
|
||
|
String cc = input.nextLine();
|
||
|
System.out
|
||
|
.println("Ihr " + aa + " am " + bb + " um " + cc + " Uhr wurde ueberarbeitet eingetragen!");
|
||
|
|
||
|
} else if (s.equals("3")) {
|
||
|
for (String ausgeben : bdays) {
|
||
|
|
||
|
System.out.println(ausgeben + "\n");
|
||
|
|
||
|
}
|
||
|
|
||
|
} else if (s.equals("4")) {
|
||
|
System.out.println("Notizen:");
|
||
|
String d = input.nextLine();
|
||
|
|
||
|
|
||
|
} else {
|
||
|
fertig = true;
|
||
|
System.out.println("Termine und Notizen wurden eingetragen; Programm wird beendet!");
|
||
|
System.out.println("-------------");
|
||
|
|
||
|
}
|
||
|
|
||
|
}break;
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
public static String gruss(String name) {
|
||
|
return "Hallo " + name + "- Willkommen in Ihrem Terminplaner";
|
||
|
}
|
||
|
}
|