A developer needs to store student IDs (integers) as keys and their corresponding grades (strings) as values, with frequent lookups. Which Picat code snippet correctly creates a map, adds a student's grade, and retrieves it?
-
A
M = [101:"A"], Grade = M[101]
-
B
M = student(101, "A"), Grade = M.2
-
C
import util.
M = new_map(), M.put(101, "A"), Grade = M.get(101)
-
D
M = new_map(), M[101] := "A", Grade = M[101]