do I not fulfill the requirements. The Program is doing all the things in the requirements.
Can you give me a little help?
package de.codegym.task.task08.task0829;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
Software-Update
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
// Todo: Mit HashMap lösen key=Nachname value=Stadt
Map<String, String> map = new HashMap<>();
String nachname, stadt, abfrage;
while (true){
stadt = reader.readLine();
nachname = reader.readLine();
map.put(stadt, nachname);
if (stadt.isEmpty() && nachname.isEmpty())
break;
}
abfrage = reader.readLine();
for (Map.Entry<String, String> paar : map.entrySet()){
if (paar.getKey().equals(abfrage))
System.out.println(paar.getValue());
}
}
}