ХЗ
package com.javarush.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/*
Добрая Зинаида и летние каникулы
*/
public class Solution {
public static Map<String, Date> createMap() throws ParseException {
DateFormat dateFormat = new SimpleDateFormat("MMMMM d yyyy", Locale.ENGLISH);
Map<String, Date> map = new HashMap<>();
map.put("Сталлоне", dateFormat.parse("MAY 1 2012"));
map.put("Сталлон", dateFormat.parse("MAY 1 2012"));
map.put("Сталло", dateFormat.parse("MAY 1 2012"));
map.put("Сталл", dateFormat.parse("MAY 1 2012"));
map.put("Стал", dateFormat.parse("August 1 2012"));
map.put("Ста", dateFormat.parse("MAY 1 2012"));
map.put("Ст", dateFormat.parse("MAY 1 2012"));
map.put("С", dateFormat.parse("MAY 1 2012"));
map.put("С1", dateFormat.parse("MAY 1 2012"));
map.put("С2", dateFormat.parse("MAY 1 2012"));
return map;
//напишите тут ваш код
}
public static void removeAllSummerPeople(Map<String, Date> map) {
for(Map.Entry<String, Date> sd:map.entrySet()){
String key = sd.getKey();
Date value = sd.getValue();
if((value.getMonth()==Calendar.JUNE) || (value.getMonth() == Calendar.JULY) ||(value.getMonth()==Calendar.AUGUST))
map.remove(key);
}
//напишите тут ваш код
}
public static void main(String[] args) {
}
}