Question
( JAVA )Create a class called EnterProduct that will contain the program whereby a company employee can enter product information into the system. You begin
(JAVA)Create a class called EnterProduct that will contain the program whereby a company employee can enter product information into the system. You begin to develop this system by writing a small portion of EnterProduct, as a test program that will capture the product information from the user and store as objects.
Within the main method of your EnterProduct class, create an object called product1 using the default constructor, as defined in the Product class ( from the previous problem) Then ask the user/employee for values of productID, productType , productPrice , productCategory and stateTax and then use these values to set all the instance variables. (5 pts)
Now we will test the 2-arg constructor - Create another product object called product2 , this time using the 2-arg constructor defined in the Product class from the previous problem. Once again, obtain the parameter values ( , productID , productName,) of this constructor from the user.
Compare the productID values of product1 and product2, and if the productID values of product1 and peroduct2 are equal, then display to the user that the ID provided for product2 is already taken. Display the productNames of the two product, as well.
We will stop our application at this point will not go further into validation of productIDs.
Complete the EnterProduct class and copy your code below.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started