Question: ArrayList Card Collector Directions: SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN Java. Notes: Assume that the classes listed in
ArrayList Card Collector Directions: SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN Java. Notes: Assume that the classes listed in the Quick Reference have been imported where needed. Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied. In writing solutions for cach question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods may not receive full credit Consider this implementation of the class Card, that stores information related to a cards monetary value, name, condition, and number in a set of collectible cards public class Card private double value: private String name: private int setNum private String condition public Card (String Name, Sering Condition, double Value, int numSet) name Name condition - Condition value-Value setNum numsel } public String getName) } public Sering ger Condition return condition: } public double getValue value; } public int getjetNarn/ return setium A subsequent class CardCollection has been created with the instance variable ArrayList Card collection that stores a collection of cards. When instantiated, the CardCollection class takes an ArrayLisCard as a parameter, and copies that ArrayList to the Collection instance variable. In this question, you will write three methods in the CardCollection class. A. Write a method totalValue() which retams the total value of all cards in a card collection B. Write a method check Perfect) that prints the name of the Cards in a collection that are in perfect condition c Write a method order Numenically that reorders the ArrayList collection in numerical order by set number. Assume that the set includes 151 cards
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
