Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedJAVAimage text in transcribed

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 minUserAge

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions