Write a Java program to create a Hashmap for various courses in an University with two fields namely, - CourseCode / Co

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post by answerhappygod »

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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply