Skip to main content
deleted 67 characters in body
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

Goal of this little project

If you could tell me howI would like to know how I could make this code more readable, I would be thankful!

Source code.

Main.javaMain.java

Test.javaTest.java

Words.javaWords.java

HelpfulFunctions.javaHelpfulFunctions.java

Goal of this little project

If you could tell me how to make this code more readable, I would be thankful!

Source code

Main.java

Test.java

Words.java

HelpfulFunctions.java

I would like to know how I could make this more readable.

Main.java

Test.java

Words.java

HelpfulFunctions.java

added 88 characters in body
Source Link
Dexter Thorn
  • 2.2k
  • 2
  • 22
  • 37
package main;

// this class contains the languages and the words that can be learned.
public class Words {
    public static String languages[] = {"English", "Deutsch", "Français"};
    
    // These array has lists of tests. A test consists of 15 words. Here all words of
    // all languages are stored. The Test class has to care about taking the words
    // the user wants to learn. How Test realizes that is described there.
    public static String words[][][] = 
    {
        { 
            {"hello", "Hallo", "bonjour"},
            {"house", "Haus", "maison"},
            {"love", "Liebe", "amour"},
            {"hate", "Hass", "haine"},
            {"luck", "Glück", "bonheur"},
            {"freedom", "Freiheit", "liberté"},
            {"tree", "Baum", "arbre"},
            {"sweet", "süß", "doux"},
            {"past", "Vergangenheit", "passé"},
            {"stupid", "dumm", "stupide"},
            {"clever", "klug", "sage"},
            {"go", "gehen", "aller"},
            {"run", "laufen", "course"},
            {"take", "nehmen", "prendre"},
            {"sleep", "schlafen", "sommeil"}
        },
        {
            {"pen", "Kugelschreiber", "stylo"},
            {"joy", "Freude", "plaisir"},
            {"happiness", "Fröhlichkeit", "bonne humeur"},
            {"beauty", "Schönheit", "beauté"},
            {"sprint", "sprinten", "sprint"},
            {"program", "programmieren", "programme"},
            {"tell", "erzählen", "dire"},
            {"scream", "schreien", "cri"},
            {"cry", "weinen", "cri"},
            {"exult", "jauchzen", "exulter"},
            {"qualify", "relativieren", "qualifier"},
            {"win", "siegen", "victoire"},
            {"lose", "verlieren", "perdre"},
            {"victory", "Sieg", "victoire"},
            {"defeat", "Niederlage", "défaite"}
        },
        {
            {"programming language", "Programmiersprache", "langage de programmation"},
            {"genius", "Genie", """génie"},
            {"eraser", "Radierer", """gomme"},
            {"train", "Zug", """train"},
            {"table", "Tisch", """table"},
            {"virtual", "virtuell", """virtuel"},
            {"real", "echt", """vraiment"},
            {"plate", "Teller", """plaque"},
            {"fork", "Gabel", """fourchette"},
            {"knife", "Messer", """couteau"},
            {"spoon", "Löffel", """cuillère"},
            {"laptop", "Klapprechner", """plieuse"},
            {"head", "Kopf", """tête"},
            {"shoulder", "Schulter", """épaule"},
            {"knee", "Knie", """genou"},
        },
        {
            {"glasses", "Brille", "lunettes"},
            {"salvation", "Heil", "salut"},
            {"possibility", "Möglichkeit", "occasion"},
            {"error", "Fehler", "erreur"},
            {"lamp", "Lampe", "lampe"},
            {"mouse", "Maus", "souris"},
            {"keyboard", "Tastatur", "clavier"},
            {"pencil case", "Federtasche", "sac à crayons"},
            {"television", "Fernseher", "TV"},
            {"feedback", "Rückkopplung", "réaction"},
            {"acquisition", "Errungenschaft", "acquisition"},
            {"tax", "Steuer", "taxe"},
            {"tabbaco", "Tabak", "tabac"},
            {"beer", "Bier", "bière"},
            {"cigarette", "Zigarette", "cigarette"},
        },
        {
            {"music", "Musik", "musique"},
            {"deny", "verneinen", "nier"},
            {"blessing", "Segen", "bénédiction"},
            {"automobile", "Auto", "voiture"},
            {"explain", "erklären", "expliquer"},
            {"proclaim", "verkünden", "annoncer"},
            {"interesting", "interessant", "intéressant"},
            {"drawer", "Schublade", "tiroir"},
            {"dog", "Hund", "chien"},
            {"cat", "Katze", "chat"},
            {"red", "rot", "rouge"},
            {"green", "grün", "bleu"},
            {"yellow", "gelb", "jaune"},
            {"blue", "blau", "bleu"},
            {"country", "Land", "pays"},
        },
    };
}
package main;

// this class contains the languages and the words that can be learned.
public class Words {
    public static String languages[] = {"English", "Deutsch", "Français"};
    
    // These array has lists of tests. A test consists of 15 words. Here all words of
    // all languages are stored. The Test class has to care about taking the words
    // the user wants to learn. How Test realizes that is described there.
    public static String words[][][] = 
    {
        { 
            {"hello", "Hallo", "bonjour"},
            {"house", "Haus", "maison"},
            {"love", "Liebe", "amour"},
            {"hate", "Hass", "haine"},
            {"luck", "Glück", "bonheur"},
            {"freedom", "Freiheit", "liberté"},
            {"tree", "Baum", "arbre"},
            {"sweet", "süß", "doux"},
            {"past", "Vergangenheit", "passé"},
            {"stupid", "dumm", "stupide"},
            {"clever", "klug", "sage"},
            {"go", "gehen", "aller"},
            {"run", "laufen", "course"},
            {"take", "nehmen", "prendre"},
            {"sleep", "schlafen", "sommeil"}
        },
        {
            {"pen", "Kugelschreiber", "stylo"},
            {"joy", "Freude", "plaisir"},
            {"happiness", "Fröhlichkeit", "bonne humeur"},
            {"beauty", "Schönheit", "beauté"},
            {"sprint", "sprinten", "sprint"},
            {"program", "programmieren", "programme"},
            {"tell", "erzählen", "dire"},
            {"scream", "schreien", "cri"},
            {"cry", "weinen", "cri"},
            {"exult", "jauchzen", "exulter"},
            {"qualify", "relativieren", "qualifier"},
            {"win", "siegen", "victoire"},
            {"lose", "verlieren", "perdre"},
            {"victory", "Sieg", "victoire"},
            {"defeat", "Niederlage", "défaite"}
        },
        {
            {"programming language", "Programmiersprache", "langage de programmation"},
            {"genius", "Genie", ""},
            {"eraser", "Radierer", ""},
            {"train", "Zug", ""},
            {"table", "Tisch", ""},
            {"virtual", "virtuell", ""},
            {"real", "echt", ""},
            {"plate", "Teller", ""},
            {"fork", "Gabel", ""},
            {"knife", "Messer", ""},
            {"spoon", "Löffel", ""},
            {"laptop", "Klapprechner", ""},
            {"head", "Kopf", ""},
            {"shoulder", "Schulter", ""},
            {"knee", "Knie", ""},
        },
        {
            {"glasses", "Brille", "lunettes"},
            {"salvation", "Heil", "salut"},
            {"possibility", "Möglichkeit", "occasion"},
            {"error", "Fehler", "erreur"},
            {"lamp", "Lampe", "lampe"},
            {"mouse", "Maus", "souris"},
            {"keyboard", "Tastatur", "clavier"},
            {"pencil case", "Federtasche", "sac à crayons"},
            {"television", "Fernseher", "TV"},
            {"feedback", "Rückkopplung", "réaction"},
            {"acquisition", "Errungenschaft", "acquisition"},
            {"tax", "Steuer", "taxe"},
            {"tabbaco", "Tabak", "tabac"},
            {"beer", "Bier", "bière"},
            {"cigarette", "Zigarette", "cigarette"},
        },
        {
            {"music", "Musik", "musique"},
            {"deny", "verneinen", "nier"},
            {"blessing", "Segen", "bénédiction"},
            {"automobile", "Auto", "voiture"},
            {"explain", "erklären", "expliquer"},
            {"proclaim", "verkünden", "annoncer"},
            {"interesting", "interessant", "intéressant"},
            {"drawer", "Schublade", "tiroir"},
            {"dog", "Hund", "chien"},
            {"cat", "Katze", "chat"},
            {"red", "rot", "rouge"},
            {"green", "grün", "bleu"},
            {"yellow", "gelb", "jaune"},
            {"blue", "blau", "bleu"},
            {"country", "Land", "pays"},
        },
    };
}
package main;

// this class contains the languages and the words that can be learned.
public class Words {
    public static String languages[] = {"English", "Deutsch", "Français"};
    
    // These array has lists of tests. A test consists of 15 words. Here all words of
    // all languages are stored. The Test class has to care about taking the words
    // the user wants to learn. How Test realizes that is described there.
    public static String words[][][] = 
    {
        { 
            {"hello", "Hallo", "bonjour"},
            {"house", "Haus", "maison"},
            {"love", "Liebe", "amour"},
            {"hate", "Hass", "haine"},
            {"luck", "Glück", "bonheur"},
            {"freedom", "Freiheit", "liberté"},
            {"tree", "Baum", "arbre"},
            {"sweet", "süß", "doux"},
            {"past", "Vergangenheit", "passé"},
            {"stupid", "dumm", "stupide"},
            {"clever", "klug", "sage"},
            {"go", "gehen", "aller"},
            {"run", "laufen", "course"},
            {"take", "nehmen", "prendre"},
            {"sleep", "schlafen", "sommeil"}
        },
        {
            {"pen", "Kugelschreiber", "stylo"},
            {"joy", "Freude", "plaisir"},
            {"happiness", "Fröhlichkeit", "bonne humeur"},
            {"beauty", "Schönheit", "beauté"},
            {"sprint", "sprinten", "sprint"},
            {"program", "programmieren", "programme"},
            {"tell", "erzählen", "dire"},
            {"scream", "schreien", "cri"},
            {"cry", "weinen", "cri"},
            {"exult", "jauchzen", "exulter"},
            {"qualify", "relativieren", "qualifier"},
            {"win", "siegen", "victoire"},
            {"lose", "verlieren", "perdre"},
            {"victory", "Sieg", "victoire"},
            {"defeat", "Niederlage", "défaite"}
        },
        {
            {"programming language", "Programmiersprache", "langage de programmation"},
            {"genius", "Genie", "génie"},
            {"eraser", "Radierer", "gomme"},
            {"train", "Zug", "train"},
            {"table", "Tisch", "table"},
            {"virtual", "virtuell", "virtuel"},
            {"real", "echt", "vraiment"},
            {"plate", "Teller", "plaque"},
            {"fork", "Gabel", "fourchette"},
            {"knife", "Messer", "couteau"},
            {"spoon", "Löffel", "cuillère"},
            {"laptop", "Klapprechner", "plieuse"},
            {"head", "Kopf", "tête"},
            {"shoulder", "Schulter", "épaule"},
            {"knee", "Knie", "genou"},
        },
        {
            {"glasses", "Brille", "lunettes"},
            {"salvation", "Heil", "salut"},
            {"possibility", "Möglichkeit", "occasion"},
            {"error", "Fehler", "erreur"},
            {"lamp", "Lampe", "lampe"},
            {"mouse", "Maus", "souris"},
            {"keyboard", "Tastatur", "clavier"},
            {"pencil case", "Federtasche", "sac à crayons"},
            {"television", "Fernseher", "TV"},
            {"feedback", "Rückkopplung", "réaction"},
            {"acquisition", "Errungenschaft", "acquisition"},
            {"tax", "Steuer", "taxe"},
            {"tabbaco", "Tabak", "tabac"},
            {"beer", "Bier", "bière"},
            {"cigarette", "Zigarette", "cigarette"},
        },
        {
            {"music", "Musik", "musique"},
            {"deny", "verneinen", "nier"},
            {"blessing", "Segen", "bénédiction"},
            {"automobile", "Auto", "voiture"},
            {"explain", "erklären", "expliquer"},
            {"proclaim", "verkünden", "annoncer"},
            {"interesting", "interessant", "intéressant"},
            {"drawer", "Schublade", "tiroir"},
            {"dog", "Hund", "chien"},
            {"cat", "Katze", "chat"},
            {"red", "rot", "rouge"},
            {"green", "grün", "bleu"},
            {"yellow", "gelb", "jaune"},
            {"blue", "blau", "bleu"},
            {"country", "Land", "pays"},
        },
    };
}
Changed some pronouns in the description, but the code comments are up for review.
Source Link
Malachi
  • 28.7k
  • 11
  • 86
  • 188

This program has the goal to teach the user words of another language. HeThe user has to learn words of a current section and than he getsthey get tested. The program can be modified easy. The programmer just has to add the new name of the language and the corresponding translations in the Words class.

This program has the goal to teach the user words of another language. He has to learn words of a current section and than he gets tested. The program can be modified easy. The programmer just has to add the new name of the language and the corresponding translations in the Words class.

This program has the goal to teach the user words of another language. The user has to learn words of a current section and than they get tested. The program can be modified easy. The programmer just has to add the new name of the language and the corresponding translations in the Words class.

deleted 2 characters in body; edited tags; edited title; edited title
Source Link
200_success
  • 144.2k
  • 22
  • 188
  • 473
Loading
Source Link
Dexter Thorn
  • 2.2k
  • 2
  • 22
  • 37
Loading