Question: In Java--- All methods work correctly per instructions arrya (add, remove, peek, print, ifFull, isEmpty) More added to the driver all neccessary attributes included with

In Java---

All methods work correctly per instructions arrya (add, remove, peek, print, ifFull, isEmpty) More added to the driver all neccessary attributes included with private access modifier header comments and javadoc included

Implement a linked list in java. Use your Can Class. You need to create a driver that makes several cans and places them in alphabetical order in a list. Identify the necessary methods in a List Linked implementation (do not forget a display method) Write a linkedList class (you will need a link class as well) Write a driver (tester) to show you have implemented all the necessary methods and appropriately defined your linkedList class

Create a can class, such as a can of soup, only it can be anything on a shelf at a grocery store. Call your file/class canYourLastName First define your class variables: Company, Content, Size (usually in ounces), Price. (decide which data types make the most sense) Next, define a default constructor (takes no arguments) and various other constructors. Next, define getters and setters and where appropriate. Next, make sure you have toString() method Make sure you have driver class called CanTesterYourLastName.java In this file, create and print objects.

Here is an example driver class:

public class canTesterRuse { public static void main(String[] args) { can SWPeaches = new can("S&W", "Peaches", 12.0, 2.39); can GreenGiantGreenBeans = new can ("Green Giant", "Green Beans"); can DelMonteCreamedCorn = new can("Del Monte", "Creamed Corn", 13.4, 2.49); GreenGiantGreenBeans.setSize(11.9); GreenGiantGreenBeans.setPrice(1.79); System.out.println("Can 1: " + SWPeaches.toString()); 
 System.out.println("Can 2: " + GreenGiantGreenBeans.toString()); 
 System.out.println("Can 3: " + DelMonteCreamedCorn); } } 
Can 1: can [Company=S&W, Content=Peaches, Size=12.0, Price=2.39] 
Can 2: can [Company=Green Giant, Content=Green Beans, Size=11.9, Price=1.79] 
Can 3: can [Company=Del Monte, Content=Creamed Corn, Size=13.4, Price=2.49] 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement a linked list in Java using the Can class as specified lets break down the solution into smaller parts Step 1 Implement the Can Class First define a class Can with the specified attribute... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!