+1(978)310-4246 credencewriters@gmail.com

I need help to do this lab. I’ve tried a few times do clearly I am doing something wrongLaboratory Exercise 6 TECH 2251
Due: October 13, 2020 Advanced Programming Technology

Todd S. Canaday, PMP
The University of Memphis
Herff College of Engineering

Program Description:

Write a Java program that will demonstrate the use of overloaded constructors within a given class. The
program will display the current inventory count for resistors, capacitors, and transistors, then using
constructors for the given class will modify those inventory numbers and display the new inventory
count for resistors, capacitors, and transistors. There will be no user interaction with this program.

The student is to create a class called ConstructorExample. This class will only contain a single method –
main(). The student is to create three variables local to this class for each component (resistors,
capacitors, and transistors) and assign them the values shown in the Example Output section below.
There will be no modifications made to the inventory of the named components within this class, all
modifications to inventory will be handled using constructors in the Components class as described
below, and the results will be assigned back to these variables after modifications have been made.
Output to the console from the main() method will reference the private member variable defined in
the Components class only. The student cannot perform the mathematical calculations to any of the
variables defined within the ConstructorExample class, they can only assign the new inventory counts to
these variables derived from the Components class.

The student will create another class which will be part of the org.uofm.tools package called
Components. There will be a private member variable called componentCount that will be used to keep
track of the inventory count for a component. There will be two constructors defined within this class.
The first will be a default constructor that displays the sentence “*** Default constructor for the
Components class.” when called. The second will be an overridden constructor that accepts three
arguments. The first argument will be a variable called ‘action’ and is of type String, the second
argument will be a variable called ‘count’ and will be of type int, and the third argument will be a
variable called ‘val’ and will be of type int. Each argument for this constructor serves a unique purpose.
The first argument determines whether to add a part count to an inventory item or subtract a part count
from an inventory item. The second argument provides the current inventory count for the component.
The third argument provides the value to either add to the inventory item or subtract from the
inventory item. Within this constructor there will be logic that will handle modifications to the
inventory count for the component based on the arguments passed to the constructor. The private
member variable componentCount will keep track of the inventory count for each component once i

error: Content is protected !!