Question: Computer Parts and Kits Write a Computerpart class and a ComputerKit class and a client class to test them). The ComputerPart class has two instance

 Computer Parts and Kits Write a Computerpart class and a ComputerKit

Computer Parts and Kits 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. 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. You should include the following methods: 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 1,000 a method returning true if a certain item is included in the list of parts: false otherwise for instance, "cpu", or "memory") is found in . a method returning how many times a particular item the list of parts ArrayList Methods Write a class that contains the following methods: reverse (ArrayList list) that reverses the order of the elements in an ArrayList list of strings. capitalizePlurals (ArrayList list) that accepts an ArrayList list of strings and replaces every word ending with an "s" with its uppercased version. Hint: use ArrayList.ends With() removePlurals (ArrayList list) that accepts an ArrayList list of strings and removes every word in the list ending with an "s", case-insensitively. ArrayList list3 intersect(ArrayList listi, ArrayList list2) that accepts two sorted array lists of integers as parameters and returns a new list that contains only the elements that are found in both lists. Example: if lists named listi and list2 initially store: listi = [1, 4, 8, 9, 11, 15, 17, 28, 41, 59] list2 = [4, 7, 11, 17, 19, 20, 23, 28, 37, 59, 81] Then the call of intersect(listi, list2) returns the list: [4, 11, 17, 28, 59) Write a client class to test all your methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!