Answered You can hire a professional tutor to get the answer.

QUESTION

Implement a linked list in java. Use your Use your Can Class. You need to make a driver that makes several cans and places them in alphabetical order...

Implement a linked list in java. Use your Use your Can Class. You need to make a driver that makes several cans and places them in alphabetical order in a list.

1.Identify the necessary methods in a List Linked implementation. Look at previous Data Structures (stack or queue) and be sure to include all necessary methods. 2.

2.Make a LinkedList class called LinkedList.java and a Link class used in LinkedList called Link.java

3.Make a driver (tester) call LinkListedDriverYourLastName.java to show you have implemented all the necessary methods and appropriately implemented your linkedList class.

Here is my Can Class.

public class can {

private String company;//creates the variables for the class

private String content;

private double size;

private double price;

public can(String c, String ct, double s, double p){// constructor with two strings and two doubles

setCompany(c);

setContent(ct);

setSize(s);

setPrice(p);

}

public String getCompany() {// setup the getters and setters

return company;

}

public void setCompany(String company) {

this.company = company;

}

public String getContent() {

return content;

}

public void setContent(String content) {

this.content = content;

}

public double getSize() {

return size;

}

public void setSize(double size) {

this.size = size;

}

public double getPrice() {

return price;

}

public void setPrice(double price) {

this.price = price;

}

@Override

public String toString() {// this is a method that will spit back the info you input for the cans

return " [Company=" + company + ", Content=" + content + ", Size=" + size + ", Price=" + price + "]";

}

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question