Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA JAVA Exercise #5: An Electronics shop wants to keep track of its inventory. It needs to save information about eachitem it has. For each
JAVA
JAVA
Exercise \#5: An Electronics shop wants to keep track of its inventory. It needs to save information about eachitem it has. For each item, it needs to know its name, minUserAge, hasBatteries, and price. 1. Create a Java class "EItem" that has the following attributes: name (String), minUserAge(int), hasBatteries(boolean) and price (double). Give all attributes a private visibility. 2. Write one constructor with parameters to fill all its attributes. 3. Create an accessor and a mutator method for each attribute. Make all methods public. 4. Create a "toString(") method to display the attributes of the class "EItem". Under the same package, create a new JFrame Form that has labels, It shouldlooks like this: Note: The Combo Box has the following options: - 0 - 3 - 5 - 7 - 9 - 11 - 13 When presses the button "Add", the information in Item Name, Min User Age, Has Batteries, and Price should be read, and an object of type "EItem" is created andinitialized with the read information. Then a string representing this object is added tothe text area. Note: If another item is added, it should be added afterthe existing list of items. From the previous exercise, add a new boolean method "isForKids" in class "EItem" that return true if the minUserAgeStep 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