Description of this paper

ComputerKit class

Description

solution


Question

Write a ComputerPart class and a ComputerKit class (and a client class to test them).;The ComputerPart class has two instance variables: a String representing an item (for instance. "cpu" or "disk drive"), and a double representing the price of the item. You will need to add accessors and mutators to the ComputerPart class. The ComputerKit class has just one instance variable: an ArrayList of ComputerPart objects (they make up a computer) representing the list of parts for the computer kit.;- a method that adds a ComputerPart to the kit.;- a method returning "expensive" if the total of the prices of the ComputerPart objects is greater than 1,000, "cheap" if it is less than 250, "normal" if it is between 250 and 1000;- a method returning true if a certain item is included in the list of parts: false otherwise;- a method returning how many times a particular item (for instance, "cpu," or "memory") is found in the list of parts

 

Paper#69249 | Written in 18-Jul-2015

Price : $32
SiteLock