Some help would be appreciated
package com.codegym.task.task10.task1019;
import javafx.scene.chart.ScatterChart;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
/*
1. The program must read data from the keyboard.
2. The program should display text on the screen.
3. In the main method, declare a HashMap variable and immediately initialize it.
4. The program should put the pairs read from the keyboard into the HashMap.
5. The program should display the contents of the HashMap in accordance with the conditions. The key and value are separated by a space. Each value should be on a new line.
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
HashMap<String,Integer> map = new HashMap<>();
while(true) {
String id = reader.readLine();
if(id.equals("")){
break;
}
String name = reader.readLine();
if(name.equals("")){
map.put("",Integer.parseInt(id));
break;
}
map.put(name,Integer.parseInt(id));
}
for (Map.Entry<String,Integer> x : map.entrySet()) {
System.out.println("Id = " + x.getValue() + " Name = " + x.getKey());
}
}
}