Write a Java application and use a Two dimensional array to store five Dutch, French and Italian
translated words. Use a single array to store the English words.
Your program must:
Q.2.1 Contain a single array to contain the following five English words and a Two
dimensional array to store the following Dutch, French and Italian translated words.
ENGLISH WORD DUTCH WORD FRENCH WORD ITALIAN WORD
sky hemel ciel cielo
run rennen courir correre
study studie etude studia
music muziek musique musica
dog hond chien cane
Q.2.2 Print out each English word with the translated Dutch, French and Italian word.
Source code
public class Main
{
public static void main(String[] args) {
String [] english={"sky","run","study","music","dog"};
String [][] translations={
{"hemel","ciel", "cielo"},
{"rennen", "courir", "correre"},
{"studie", "etude", "studia"},
{"muziek", "musique", "musica"},
{"hond", "chien", "cane"}
};
System.out.println("English\t\tDutch\t\tFrench\t\tItalian");
System.out.println("*********************************************************");
for(int i=0;i<english.length;i++){
System.out.print(english[i]+"\t\t");
for(int j=0;j<translations[0].length;j++){
System.out.print(translations[i][j]+"\t\t");
}
System.out.println();
}
}
}
Output
Comments
Leave a comment