Page 1 of 1

Part class Create a class called 'Part' that contains information on different parts. Members: partNo - String - The inv

Posted: Thu May 05, 2022 12:43 pm
by answerhappygod
Part Class Create A Class Called Part That Contains Information On Different Parts Members Partno String The Inv 1
Part Class Create A Class Called Part That Contains Information On Different Parts Members Partno String The Inv 1 (25.09 KiB) Viewed 30 times
Part class Create a class called 'Part' that contains information on different parts. Members: partNo - String - The inventory part number (a String of 10 Alphanumeric characters) partName.- String -Name of the part • partDese-String - Text description of the part • countOn Hand-int-number of parts available Write getters for each field. Setters are not needed except for countOnHand which is altered by several methods described below. Write at least 1 constructor that takes a reasonable set of arguments to create a new Part.
addInventory() public void addInventory(int amount); This method adds the amount to countOn Hand. decrementInventory() public void decrementInventory(); This reduces countOn Hand by 1. dumpPart() public void dumpPart(); Finally, add a method, dumpPart() which will print out information on the part. It should minimally list the partNo, partName and countOnHand. This will be used for debugging as you write more of the code for the system. Testing Write a UsePart class with a main method that calls your Part methods with various data and arguments. Make sure the methods work as expected before moving on.