subject

Create a class to represent light bulbs Create a class called Bulb that will represent a light bulb. It should have instance variables for the manufacturer (String), part number (String), wattage (int) and lumens (int). Get and Set methods should be included. Override the equals and to String methods from class Object.
List of Bulbs
Create a class called BulbNode which has fields for the data (a Bulb) and next (BulbNode) instance variables. Include a one-argument constructor which takes a Bulb as a parameter. (For hints, see the PowerPoint on "Static vs. Dynamic Structures".)
public BulbNode (Bulb b) {...}
The instance variables should have protected access. There will not be any get and set methods for the two instance variables.
Create an abstract linked list class called BulbList. This should be a linked list with head node as described in lecture. Modify it so that the data type in the nodes is Bulb. The no-argument constructor should create an empty list with first and last pointing to an empty head node, and length equal to zero. Include an append method in this class.
Create two more linked list classes that extend the abstract class BulbList: One called UnsortedBulbList and one called SortedBulbList, each with appropriate no-argument constructors. Each of these classes should have a method called add(Bulb) that will add a new node to the list. In the case of the UnsortedBulbList it will add it to the end of the list by calling the append method in the super class. In the case of the SortedBulbList it will insert the node in the proper position to keep the list sorted by wattage.
Instantiate two linked lists, and for every Bulb read from the file, add it to the unsorted and sorted lists using the add method. You will end up with the first list having the Bulbs from the input file in the order they were read, and in the second list the Bulbs will be in sorted order.
Display the unsorted and sorted Bulbs in a GUI with a GridLayout of one row and two columns. Put the unsorted Bulbs in the left column, and the sorted Bulbs in the right column.
The input file
There will be an input file provided on Blackboard which contains information about bulbs, one per line, with the manufacturer, part number, wattage and lumens separated by commas, such as:
Phillips, 1237DF2, 100, 1200
You can separate the four items using a StringTokenizer.
Submitting the Project.
You should now have the following files to submit for this project:
Project2.java
Bulb. java
BulbGUI. java
BulbNode. java
BulbList. java
UnsortedBulbList. java
SortedBulblist. java
Submit a jar file.
Rather than upload all the files above separately, we will use Java's facility to create the equivalent of a zip file that is known as a Java Archive file, or "jar" file.
Instructions on how to create a jar file using Eclipse are on Blackboard. Create a jar file called Project2.jar and submit that. Be sure the jar file contains source code, not classes.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Someone with this coz i don’t really know what i can choose, just pick whatever u want. homework - you need to choose a website that you like or use frequently. you must visit the website and discuss 6 different features/parts/aspects of the website that you think makes it good. (100 words)
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
What is the foundation for proper monitoring, load balancing and routing in distributed systems
Answers: 3
question
Computers and Technology, 22.06.2019 19:30
Once the data center routes to the destination server that hosts the website, what's the next step in the internet process? user’s browser renders html code from destination server into web page request goes through router/model and isp request routed to nameserver and datacenter
Answers: 2
question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
You know the right answer?
Create a class to represent light bulbs Create a class called Bulb that will represent a light bulb...
Questions
question
Geography, 22.01.2021 19:30
question
Spanish, 22.01.2021 19:30
Questions on the website: 13722360