Java
Java
management;
import java.util.*;
// Custom Exceptions
class InvalidCustomerException extends Exception {
public InvalidCustomerException(String message) {
super(message);
}
}
// Customer Class
class Customer {
private int id;
private String name;
private String contact;
private List<String> history;
// Inheritance Example
class CorporateCustomer extends Customer {
private String companyName;
// Lead Class
class Lead {
private int id;
private String potentialCustomer;
// Sales Representative
class SalesRepresentative {
private int id;
private String name;
private List<Customer> assignedCustomers;
@Override
public void resolve() {
System.out.println("Phone support resolving issue: " + issue);
}
}
@Override
public void resolve() {
System.out.println("Email support resolving issue: " + issue);
}
}
// Invoice Class
class Invoice {
private int invoiceId;
private Customer customer;
private double amount;
try {
Customer c1 = new IndividualCustomer(1, "John Doe", "[email protected]");
crm.addCustomer(c1);
crm.createServiceRequest(new PhoneSupport(101, c1, "Internet not working"));
crm.serviceRequests.get(101).resolve();
} catch (InvalidCustomerException e) {
System.out.println("Error: " + e.getMessage());
}
}
}