Write a Java program to create a Hashmap for various courses in
an University with two fields namely,
- CourseCode / Course ID (which is the key field, this field
is unique) and
- Number of students enrolled under each Coursecode / Course
ID.
Every entry in this HashMap will have a pair of CourseCode and
the corresponding number of students enrolled under this
course.
Insert the (CourseCode, NumberofStudents) fields for every
entry.
To insert the values into a HashMap either you can use Scanner
class to get user input or you can insert the values directly into
the HashMap.Insert two or three entries into the HashMap and print
the contents of the HashMap.
Write a Java program to create a Hashmap for various courses in an University with two fields namely, - CourseCode / Co
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Write a Java program to create a Hashmap for various courses in an University with two fields namely, - CourseCode / Co
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!