Given the Customer class and driver described in the previous exercise, add code that removes from the

Question:

Given the Customer class and driver described in the previous exercise, add code that removes from the customers list the discouraged customer who has been standing immediately behind (after) the friend customer and then generates the following output:

<discouraged customer’s name> goes home

Exercise 10.8

Assume a Customer class has a constructor with a name parameter that initializes a name instance variable, and assume this class includes a getName method. A driver for this class includes this code:

LinkedList customers new Linked List (); Customer friend = new Customer( Transcribed Image Text:

LinkedList customers new Linked List (); Customer friend = new Customer("Pratima"); int index; = customers.add(new Customer("Pranoj ")); customers.add(new Customer ("Rachel")); customers.add(friend); customers.add(new Customer("Mohammad")); customers.add(new Customer("Jasur")); customers.add(new Customer("Shyan"));

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question
Question Posted: