Ich sitze schon seit über 6h an den Programmieraufgaben und stehe wieder an. Ich bin schon langsam am Verzweifeln. Könnt ihr mir bei dieser Aufgabe helfen?
Als Ausgabe muss dann z.B. stehen:
abcd hat eine Stärke von 0 switches und eine Passwortst. von 4
Mein Ansatz wäre:
public class Passwort {
public static void main(String[] args) {
static final int anzahl = 8;
int strenght, switches, lenght;
stirng passwords[] = new String[anzahl];
In.open("Passwords.txt");
int switches = 0;
while (In.done()) {
for (int i = 0; i < anzahl; i++) {
if (passwords[i].isUppercase) {
switches++;
}
strenght = passwords[i].lenght * (switches + 1);
}
In.peek();
}
In.close();
}
}
Aber es funktioniert nichts. Was mache ich falsch?