Hello, I've attached the prompt for this assignment. I need help creating code to delete and update in the contactService.java according to the prompt. This is my partial code.  package Contact; import java.util.ArrayList; public class ContactService { //Start with an ArrayList of contacts to hold the list of contacts     ArrayList contactList = new ArrayList();     //Display the full list of contacts to the console for error checking.     public void displayContactList() {         for(int counter = 0; counter < contactList.size(); counter++) {

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello, I've attached the prompt for this assignment. I need help creating code to delete and update in the contactService.java according to the prompt. This is my partial code. 

package Contact;

import java.util.ArrayList;

public class ContactService {
//Start with an ArrayList of contacts to hold the list of contacts
    ArrayList<Contact> contactList = new ArrayList<Contact>();

    //Display the full list of contacts to the console for error checking.
    public void displayContactList() {
        for(int counter = 0; counter < contactList.size(); counter++) {
        System.out.println("\t Contact ID: " + contactList.get(counter).getContactID());
        System.out.println("\t First Name: " + contactList.get(counter).getFirstName());
        System.out.println("\t Last Name: " + contactList.get(counter).getLastName());
        System.out.println("\t Phone Number: " + contactList.get(counter).getNumber());
        System.out.println("\t Address: " + contactList.get(counter).getAddress() + "\n");
    }
}
    //Adds a new contact using the Contact constructor, then assign the new contact to the list.
    public void addContact(String firstName, String lastName, String number, String address) {
        // Create the new contact
        Contact contact = new Contact(firstName, lastName, number, address);
        contactList.add(contact);
        }

This is my completed Contact.java

 

Prompt
For Project One, which is due in Module Six, you are asked to develop a mobile application for a customer. The customer will provide you with the
requirements. Your job is to code the application and provide unit tests to verify that the application meets the customer's requirements. For this
milestone, you will focus on delivering the contact services. The purpose of these services is to add, update, and delete contact objects within the
application.
The contact service uses in-memory data structures to support storing contacts (no database required). In addition, there is no user interface for
this milestone. You will verify the contact service through JUnit tests. The contact service contains a contact object along with the contact service.
The requirements are outlined below.
Contact Class Requirements
●
The contact object shall have a required unique contact ID string that cannot be longer than 10 characters. The contact ID shall not be null
and shall not be updatable.
●
The contact object shall have a required firstName String field that cannot be longer than 10 characters. The firstName field shall not be null.
The contact object shall have a required lastName String field that cannot be longer than 10 characters. The lastName field shall not be null.
●
●
The contact object shall have a required phone String field that must be exactly 10 digits. The phone field shall not be null.
●
The contact object shall have a required address field that must be no longer than 30 characters. The address field shall not be null.
Contact Service Requirements
The contact service shall be able to add contacts with a unique ID.
• The contact service shall be able to delete contacts per contact ID.
The contact service shall be able to update contact fields per contact ID. The following fields are updatable:
O firstName
O lastName
。 Number
• Address
Transcribed Image Text:Prompt For Project One, which is due in Module Six, you are asked to develop a mobile application for a customer. The customer will provide you with the requirements. Your job is to code the application and provide unit tests to verify that the application meets the customer's requirements. For this milestone, you will focus on delivering the contact services. The purpose of these services is to add, update, and delete contact objects within the application. The contact service uses in-memory data structures to support storing contacts (no database required). In addition, there is no user interface for this milestone. You will verify the contact service through JUnit tests. The contact service contains a contact object along with the contact service. The requirements are outlined below. Contact Class Requirements ● The contact object shall have a required unique contact ID string that cannot be longer than 10 characters. The contact ID shall not be null and shall not be updatable. ● The contact object shall have a required firstName String field that cannot be longer than 10 characters. The firstName field shall not be null. The contact object shall have a required lastName String field that cannot be longer than 10 characters. The lastName field shall not be null. ● ● The contact object shall have a required phone String field that must be exactly 10 digits. The phone field shall not be null. ● The contact object shall have a required address field that must be no longer than 30 characters. The address field shall not be null. Contact Service Requirements The contact service shall be able to add contacts with a unique ID. • The contact service shall be able to delete contacts per contact ID. The contact service shall be able to update contact fields per contact ID. The following fields are updatable: O firstName O lastName 。 Number • Address
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education