Exercise 1: An Electronics Shop wants to keep track of its inventory. It needs to save information about each item it ha
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Exercise 1: An Electronics Shop wants to keep track of its inventory. It needs to save information about each item it ha
Exercise 1: An Electronics Shop wants to keep track of its inventory. It needs to save information about each item it has. For each item, it needs to know its name, minUser Age, hasBatteries, and price. 1. Create a Java class "eltem" that has the following attributes: name (String), minuserAge (int), hasBatteries(boolean) and price (double). Give all attributes a private visibility. 2. Write two constructors for the class eltem: one without parameters, and another 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 " "eltem". Using GUI: X Electronics Shop Item Name: . Min User Age: 0 Has Batteries 1. Under the same package, create a JFrame Form and call it "eltem” that has labels, It should looks like this: Note: The Combo Box has the following options: 0 3 5 7 9 11 13 Price (AED): ADD . Items List: . .
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!