-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
26 lines (23 loc) · 861 Bytes
/
Main.java
File metadata and controls
26 lines (23 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.yurii.salimov.lesson08.task03;
/**
* 8.3 Задача
*
* Дан словарь в виде «англ. слово=русское слово, англ.
* слово=русское слово,…». Написать программу переводчик
* на основе словаря.
*
* @author Yuriy Salimov (yuriy.alex.salimov@gmail.com)
*/
public class Main {
public static void main(String[] args) {
printEnglishAlphabet();
}
private static void printEnglishAlphabet() {
final String dictionary = "Hello=Привет; World=Мир";
final String line = "Hello World";
final Translator translator = new TranslatorImpl(dictionary);
final String translatedLine = translator.translate(line);
System.out.println(line);
System.out.println(translatedLine);
}
}