Improved the Gaptext
This commit is contained in:
parent
735fd61747
commit
7cf18e66db
2 changed files with 5 additions and 8 deletions
Binary file not shown.
|
@ -31,23 +31,20 @@ public class Grundlagen {
|
|||
}
|
||||
|
||||
// Lückentexte / kombination aus variablen, print und if/else
|
||||
// Display a popup dialog and get user input
|
||||
|
||||
// Popups mit User Input
|
||||
String a = JOptionPane.showInputDialog("Please enter a verb (-ing):");
|
||||
String b = JOptionPane.showInputDialog("Please enter a location:");
|
||||
String c = JOptionPane.showInputDialog("Please enter a color:");
|
||||
String d = JOptionPane.showInputDialog("Please enter an object in that color:");
|
||||
String d = JOptionPane.showInputDialog("Please enter something that's that color:");
|
||||
String e = JOptionPane.showInputDialog("Please enter a diffrent color:");
|
||||
String f = JOptionPane.showInputDialog("Please enter an object in that color:");
|
||||
String f = JOptionPane.showInputDialog("Please enter something that's that color:");
|
||||
String g = JOptionPane.showInputDialog("Please enter an adjective:");
|
||||
String h = JOptionPane.showInputDialog("Please enter an object");
|
||||
|
||||
// Error message
|
||||
|
||||
if ((a == null || a.trim().isEmpty()) && (b == null || b.trim().isEmpty())) {
|
||||
System.out.println("Missing word(s) or canceled.");
|
||||
} else if (a == null || a.trim().isEmpty()) {
|
||||
if (a == null || a.trim().isEmpty()) {
|
||||
System.out.println("Missing word(s) or canceled.");
|
||||
} else if (b == null || b.trim().isEmpty()) {
|
||||
System.out.println("Missing word(s) or canceled.");
|
||||
|
@ -67,8 +64,8 @@ public class Grundlagen {
|
|||
|
||||
// Lückentext mit variablen
|
||||
|
||||
System.out.println("They where " + a + " throw a " + b + ". They're eyes where ");
|
||||
System.out.println(c + " as the " + d + " They're hair as " + e + " as " + f + ".");
|
||||
System.out.println("They where " + a + " throw (a) " + b + ". They're eyes where ");
|
||||
System.out.println(c + " as (the) " + d + " They're hair as " + e + " as (the) " + f + ".");
|
||||
System.out.println("It was a " + g + " day, after a long journey they finally found their " + h);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue