Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in Java to store a collection of movie names. There should be no duplicate movies in the collection. The program must be

  1. Write a program in Java to store a collection of movie names. There should be no duplicate movies in the collection. The program must be able to (20 mark):
  • add a movie
  • remove a movie
  • check if a movie exists
  • delete all movies
  • print out the number of movies
  • print a list of all movie names

use HashSet

  1. Write a program in java that implements a HashMap to store students (student IDs as the key, and student names as the value). The program must be able to (10 mark):
  • add some students, then print all students’ name
  • remove all of the students at once

Step by Step Solution

3.31 Rating (160 Votes )

There are 3 Steps involved in it

Step: 1

HashSetExjava import javaio import javautil public class HashSetEx public static Set s1 new HashSet ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals of Cost Accounting

Authors: William Lanen, Shannon Anderson, Michael Maher

3rd Edition

9780078025525, 9780077517359, 77517350, 978-0077398194

More Books

Students also viewed these Programming questions