I am a couple beginner and am trying to create a solution to learn new vocabulary (english - german).
As I am stuck I need help to make it work as I am not sure nor currenty understand what to correct to make it work.
I would appreciate if someone could help me to finish it.
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub //--------------------- declarations ---------------------------------------- //--------------------- Greeting ---------------------------------------- System.out.println("Willkommen im Wortschatz-Trainer!"); //--------------------------------Input & List of words --------------------------------------------- Scanner keyScan = new Scanner(System.in); String [] deutsch = {"ja","nein","vielleicht","wo","wann","wer","Zug","Schiff","Fahrrad"}; String [] englisch = {"yes","no","maybe","where","when","who","train","ship","bike"}; int [] score = new int [deutsch.length]; //--------------------------- Round 1--------------------------------------------------------------- System.out.println("Runde 1:"); for (int i=0; i<deutsch.length; i++) { System.out.print("Englisch: "+englisch[i]+" Deutsch: "); String answer = keyScan.nextLine(); // TODO: Prüfe die Antwort mit checkAnser. Speichere die Bewertung im Array score //--------------------------- Check Answer -------------------------------------------- System.out.print(checkAnswer(correct, answer)); //--------------------------- Save Points -------------------------------------------- //-------------------------------------- End Round 1 --------------------------------------------- } //----------------- Goto printScore --------------------------- //printScore(score); //-------------------------------------------- Finish ----------------------------------------------- keyScan.close(); } //--------------------- Check if the entered Word is correct or false (give points) ---------------------------------------- static int checkAnswer( String wort, String eingabe) { // TODO if (wort.equals(eingabe)) { return 2; }else if (wort.equalsIgnoreCase(eingabe)) { return 1; }else{ return 0; } } //--------------------- Score Output ---------------------------------------- public static void printScore(int [] score) { // TODO int countR = 0; int countFr = 0; int countF = 0; int count = 0; for (int y=0;y<score.length;y++) { if (score [y]==2) { count = count+score [y]; countR=countR+1; }else if (score [y]==1){ count = count+score [y]; countFr = countFr+1; }else { countF=countF+1; } System.out.println("Richtig: "+countR+" Fast richtig: "+countFr+" Falsch: "+countF+" Punkte: "+count); } } }