Question: Java2 1)Complete violation() method to find list of students who have taken CS211 without taking CS210, a prerequisite for CS 211. 2) Complete CS210andCS211notCS212Classes() method
Java2
1)Complete violation() method to find list of students who have taken CS211 without taking CS210, a prerequisite for CS 211. 2) Complete CS210andCS211notCS212Classes() method to find list of students who have taken CS 210 and CS 211 but have not taken CS 212. Expected output: CS211 without taking CS 210: [kim] CS 210 and CS 211 but not CS 212: [Eva] Restrictions: You should NOT update the original HashSet. This is the set operation practice we studied yesterday. Only .addAll(), .retainAll(), .removeAll() should be used.
import java.util.*;
public class q5 {
static HashSet
public static void violation() { } public static void CS210andCS211notCS212Classes() { } public static void main(String[] args) { Initialize(); violation(); CS210andCS211notCS212Classes(); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
