[Solved] COP 4814 Lab 8 Students and Courses Part 2

$25

File Name: COP_4814_Lab_8__Students_and_Courses_Part_2.zip
File Size: 405.06 KB

SKU: [Solved] COP 4814 Lab 8 – Students and Courses Part 2 Category: Tag:
5/5 - (1 vote)

5/5 – (4 votes)

(Java Maps and Lists) You created the Students and Courses application (Part 1) in Lab 1.

Now you are asked to improve it in the following ways:

(1) Create a TreeMap of course names. Each map entry should contain a single integer that counts the number of students who have enrolled in that course.

(2) Display the map in ascending order by course name, showing each course name and its enrollment count.

Note: You cannot directly increment the enrollment count in a map entry. Instead, retrieve the existing count using the get() method, add 1 to the count, and then insert the key and updated enrollment count back into the map by calling the put() method.

The final test program should display the following output with different names and courses.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] COP 4814 Lab 8 Students and Courses Part 2
$25