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
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:

Add code that inserts into the customers list a new customer named “Peter”. Make the insertion immediately before the friend object.
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"));
Step by Step Solution
3.29 Rating (155 Votes )
There are 3 Steps involved in it
Based on the code snippet provided which describes a Customer class and a LinkedList of Customer objects the task is to 1 Insert a new customer named ... View full answer
Get step-by-step solutions from verified subject matter experts
