Skip to content

Commit 953f4b2

Browse files
authored
thou hast magnified thy word above all thy name
[A Psalm] of David. I will praise thee with my whole heart: before the gods will I sing praise unto thee. I will worship toward thy holy temple, and praise thy name for thy lovingkindness and for thy truth: for thou hast magnified thy word above all thy name (Psalm 138:1)
1 parent 0096242 commit 953f4b2

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
// [A Psalm] of David. I will praise thee with my whole heart: before the gods will I sing praise unto thee.
3+
// I will worship toward thy holy temple, and praise thy name for thy lovingkindness and for thy truth:
4+
// for thou hast magnified thy word above all thy name (Psalm 138:1)
5+
6+
package com.javarush.task.task40.task4009;
7+
8+
import java.time.LocalDate;
9+
import java.time.Year;
10+
import java.time.format.DateTimeFormatter;
11+
import java.util.Locale;
12+
import java.time.format.FormatStyle;
13+
14+
/*
15+
Buon Compleanno!
16+
*/
17+
18+
public class Solution {
19+
public static void main(String[] args) {
20+
System.out.println(weekDayOfBirthday("30.05.1984", "2015"));
21+
}
22+
23+
public static String weekDayOfBirthday(String birthday, String year) {
24+
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("d.M.yyyy", Locale.ITALIAN); //напишите тут ваш код
25+
LocalDate localDate = LocalDate.parse(birthday, dateTimeFormatter);
26+
localDate = localDate.with(Year.parse(year));
27+
return DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL).withLocale(Locale.ITALIAN).format(localDate).split(" ")[0];
28+
}
29+
}
30+
31+
/*
32+
Buon Compleanno!
33+
Реализуй метод weekDayOfBirthday.
34+
Метод должен возвращать день недели на итальянском языке, в который будет (или был) день рождения в определенном году.
35+
Пример формата дат смотри в методе main.
36+
37+
Пример:
38+
1) Для "30.05.1984" и "2015" метод должен вернуть: sabato
39+
2) Для "1.12.2015" и "2016" метод должен вернуть: gioved?
40+
41+
Выполни задание, используя Java 8 DateTime API.
42+
43+
44+
Требования:
45+
1. Используй статический метод parse класса LocalDate.
46+
2. Используй статический метод parse класса Year.
47+
3. Используй локаль Locale.ITALIAN.
48+
4. Метод weekDayOfBirthday должен возвращать правильный день недели для передаваемых параметров.
49+
*/

0 commit comments

Comments
 (0)