// The purpose of the class is to evaluate the correctness of // both the the BookMembershipCard and the CMembershipCard as well. // Get an instance of a member's cd card MC = BK.getMember (0).getCard (0); // I can only have one card at a time // First we check if MC is indeed the instance of a CMembershipCard. // (instanceof returns a boolean value.) If (MC instanceof CDMembershipCard) // Print the appropriate messages to the console, so as to inform the user // what we are doing. System.out.println ("Retrieving Artur Miller's CD Membership Card."); System.out.println ("Taking 2 items."); MC.takeItemsOnApproval (2); System.out.println ("Returning 1 item."); MC.returnItems (1); System.out.println ("Bying 8 items."); MC. buyItems(8); // Get an instance of a member's book card MC = BK.getMember (0).getCard (1); // First we check if MC is indeed the instance of a BookMembershipCard. // (instanceof returns a boolean value.) If (MC instanceof BookMembershipCard) // Print the appropriate messages to the console, so as to inform the user // what we are doing. System.out.println ("Retrieving Henry Rammstein's Book Membership Card."); System.out.println ("Taking 2 items."); MC.takeItemsOnApproval (2); System.out.println ("Returning 3 items."); MC.returnItems (3); System.out.println ("Bying 2 items."); MC. buyItems (2); } // End of main. } // End of TestClass.