project CustomerRequests: a) Create a class named Customer. This class contains the following information about the customer: first name, last name, social insurance number, age, and a list of requests. This class also contains a method named makeRequest which adds a request to the list of requests. Note that the Customer class has 4 attributes, no more. b) Create a class named CustomersProcessor. This class has two attributes: a list of customers and also a counter for the total number of requests that are present to the various lists of requests. This class also has the following methods: addCustomer, which adds a customer to the list of customers; removeCustomer, which removes a customer from the list of customers; and processCustomerRequest, which processes a specific request from a specific customer after receiving the necessary information to do so. Processing a request prints to the console the message "Request #x processed", where x is the number of the request that has just been processed. Meaning, you must find a way to give a number (an id) to each request. Processing a request also removes it from the list of requests of the specified customer. Make sure that only one object of type CustomersProcessor can be created. 2. In the project CustomerRequests:
In the java project CustomerRequests:
a) Create a class named Customer. This class contains the following information about the customer: first name, last name, social insurance number, age, and a list of requests. This class also contains a method named makeRequest which adds a request to the list of requests. Note that the Customer class has 4 attributes, no more. b) Create a class named CustomersProcessor. This class has two attributes: a list of customers and also a counter for the total number of requests that are present to the various lists of requests. This class also has the following methods: addCustomer, which adds a customer to the list of customers; removeCustomer, which removes a customer from the list of customers; and processCustomerRequest, which processes a specific request from a specific customer after receiving the necessary information to do so. Processing a request prints to the console the message "Request #x processed", where x is the number of the request that has just been processed. Meaning, you must find a way to give a number (an id) to each request. Processing a request also removes it from the list of requests of the specified customer. Make sure that only one object of type CustomersProcessor can be created.
2. In the project CustomerRequests:
a) Create a class named ExCustomer, child of the Customer class. This class contains a method named addExCustomer. This method can add an ex-customer to the list of customers of the CustomersProcessor class, but only if the ex-customer has at least one request in his/her list of requests.
b) Make sure that the methods from the Customer and ExCustomer classes cannot be called from the main method.
c) Create Javadocs for the attributes and methods of the Customer, ExCustomer and CustomersProcessor classes.
3.
In the project CustomerRequests: Create a new package and name it UI_package. Then, in this package, by using the Swing API, create a UI which contains enough buttons to call the methods described in #1 and #2. Each button, when clicked on, calls one of those methods. If a method prints text to the console, that text is written in a pop-up that shows up on the screen. If a method needs arguments, those arguments can be hard-coded by you. No need to involve the UI.
Step by step
Solved in 2 steps