Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: I am trying to build a vocabulary learning program and need urgently help to solve issues with the method etc. to make it work

  1. #1
    Junior Member
    Join Date
    Sep 2021
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation I am trying to build a vocabulary learning program and need urgently help to solve issues with the method etc. to make it work

    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);					
     
    						}
     
     
     
     
    	   }
    	}

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: I am trying to build a vocabulary learning program and need urgently help to solve issues with the method etc. to make it work

    need urgently help to solve issues
    Please make a list of the problems you are having. Then work on each problem one at a time.
    Post the list and your questions/comments about the problem you are having with the item you are working on.

    Please fix the indentations for the code. There is a section that has too much indentation.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. New application for learning english vocabulary
    By tingtongapps in forum The Cafe
    Replies: 0
    Last Post: July 31st, 2014, 05:59 AM
  2. [SOLVED] super() function how to make my program work without it
    By chalupabatman in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 3rd, 2014, 09:53 PM
  3. HELP JAVA PROGRAM ! Urgently
    By halimamaw in forum Loops & Control Statements
    Replies: 6
    Last Post: August 11th, 2013, 01:02 AM
  4. unable to make thi work - program connectfour
    By sumoon in forum What's Wrong With My Code?
    Replies: 1
    Last Post: June 14th, 2013, 04:23 AM
  5. Need help with coding - Vocabulary Database Program
    By wogns10 in forum Java Theory & Questions
    Replies: 1
    Last Post: February 20th, 2012, 04:40 AM