Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please read the instruction carefully and do as the assignment is asking for. please provide proper comments. There should be four different classes 1)Contact.java 2)Queue.java

image text in transcribed

image text in transcribed

Please read the instruction carefully and do as the assignment is asking for. please provide proper comments.

There should be four different classes

1)Contact.java

2)Queue.java

3)Stack.java

4)YourNameAssignment3.java

please let me know where each file starts

all should be indifferent class (on a different page) on eclipse.

Contact Class Design a class called Contact (the class file should be called Contact.java) that implements a contact listings class, with the following exact? fields/data members/attributes and methods/operations in this order: Field/Method Description Name This field holds the name of the contact Address This field holds the physical address of the contact Phone This field holds the phone number of the contact Email This field holds the email address of the contact Contact This constructor creates a contact with the 4 values received as parameters Input This method inputs a contact (the 4 values for the 4 fields) from the console Output This method outputs the contact (the 4 fields) to the console ToString This method serializes the contact into a string: NAME=Name, ADDRESS=Address, PHONE=Phone, EMAIL=Email DeepCopy This method creates and returns a deep copy of the contact Compare This method compares 2 contacts and returns true if they are equal (same name) and false if not Update This method updates the fields with the values received from parameters Design a class called Queue (class java file name Queue.java) that encodes an expanded version of a queue class, with the following exact' fields/data members/attributes and methods/operations in this order: Field/Method Data Size Front Rear Queue Queue Enque Deque Output Empty IsEmpty Peek Find Description This field holds the data, an array of Contacts This field holds the size (maximum number of nodes) of the queue This field holds the position of the front of the queue This field holds the position of the rear of the queue This constructor with no parameters initializes the fields of the queue This constructor creates a queue of a size given by the parameter This method inserts the node (given by the parameter) to the queue This method fetches and deletes a node from the queue and returns it This method outputs all the values from the queue This method reinitializes the queue to the empty queue This method tests if the queue is empty (underflow condition) This method peeks at the queue (look at the first position) and outputs it This method finds a contact in the queue (receives the contact name as a parameter), outputs the contact and returns the position (or -1 if not in the queue) Design a class called Stack (the class java file name Stack.java) that encodes an expanded version of a stack class, with the following exact fields/data members/attributes and methods/operations in this order: Field/Method Description Data This field holds the data, an array of Contacts Top This field holds the top of the stack Size This field holds the size of the stack Stack This constructor with no parameters initializes the fields of the stack Stack This constructor creates a stack of a size given by the parameter Push This method inserts the node (given by the parameter) to the Stack Pop This method fetches and deletes a node from the stack and returns it Output This method outputs all the values from the stack Empty This method reinitializes the stack to the empty stack IsEmpty This method tests if the stack is empty (underflow condition) Peek This method peeks at the stack (look at the first position) and outputs it Find This method finds a contact in the stack (receives the contact name as a parameter), outputs the contact and returns the position (or -1 if not in the queue) Finally, once you have designed the 2 classes (Queue and Stack), design a program/project/driver class called Your Name Assignment3; replace Your Name with your actual name (class file name Your NameAssignment2.java), add the Contact, Queue, and Stack classes to the project. Then, inside the driver class main method, add code to create 3 objects of each of the classes Queue and Stack (MyQueuel, MyQueue2, My Queue3, MyStack1, MyStack2, and MyStack3) using different constructors and demonstrate the functionality of all the methods from the 2 classes (i.e use all the methods and output the structures or returned values after each operation to show the functionality)

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

Students also viewed these Databases questions

Question

List the nodes in decision trees.

Answered: 1 week ago

Question

=+ What are the information and consultation requirements?

Answered: 1 week ago

Question

=+ Should the MNE belong (why, why not)?

Answered: 1 week ago