Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help the main class ( AdapterPatternTest ) for the expected output for External Customer Alice? public class ExternalCustomer { private String name; private String phoneNumber;

Help the main class (AdapterPatternTest) for the expected output for External Customer Alice?

public class ExternalCustomer {

private String name; private String phoneNumber; private String address;

public ExternalCustomer(String name, String phoneNumber, String address) { this.name = name; this.phoneNumber = phoneNumber; this.address = address; }

public String getName() { return name; }

public void setName(String name) { this.name = name; }

public String getPhoneNumber() { return phoneNumber; }

public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; }

public String getAddress() { return address; }

public void setAddress(String address) { this.address = address; } }

public interface IVerify {

boolean verifyCustomer(Customer customer);

}

public class InHouseVerifier implements IVerify {

@Override public boolean verifyCustomer(Customer customer) { // TODO Auto-generated method stub return false; }

}

public class ABCValidator {

public static boolean validate(String name, String phoneNumber) { // TODO Auto-generated method stub return false; }

}

public class ABCAdapter implements IVerify {

@Override public boolean verifyCustomer(Customer customer) { // TODO Auto-generated method stub return false; }

}

public class XYZChecker {

public static boolean backgroundCheck(String name, String address) { // TODO Auto-generated method stub return false; }

}

import java.text.DateFormat; import java.util.List; import java.util.ArrayList; import java.util.Date;

public class Customer { private final String name; private final String customerId; private final Date registrationDate; private final List accountList; public Customer(String name, String customerId, Date registrationDate) { this.name = name; this.customerId = customerId; this.registrationDate = registrationDate; this.accountList = new ArrayList<>(); }

public String getName() { return this.name; }

public String getCustomerId() { return this.customerId; }

public Date getRegistrationDate() { return this.registrationDate; }

public void addAccount(Account account) { accountList.add(account); /* Add the account to the customer's accountList */ }

public void printStatement(Date toDate) {

System.out.println(" BEGIN ACCOUNT STATEMENT - " + this.getName() + " - " + DateFormat.getDateInstance().format(toDate)); for(int i=0; i < accountList.size(); i++) { accountList.get(i).printStatement(toDate); }

System.out.println(" END ACCOUNT STATEMENT "); }

}

public class AdapterPatternTest {

public static void main(String[] args) { // TODO Auto-generated method stub

}

}

Expected output:

Doing in house verification for Alice

ABC third-party verification for Alice, 222-33-4444

XYZ third-party background verification for Alice, 123 MAin St, Boston, MA

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

Recommended Textbook for

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions

Question

Define the term green computing, and state its primary goals.

Answered: 1 week ago

Question

Define self-discipline and cite its benefits.

Answered: 1 week ago