The Order class is an abstraction of customer orders. You are asked to code only ONE static method for this class. Most of the class has been implemented by someone else. You can use some of those methods to code the static method.
The static method prompts the user to enter a customer name at one line and a delivery address at another line. It returns an Order object that contains the customer name and the relevant parts of the delivery address. The user will always use this format: a street name, followed by a city name, followed by a province code, and followed by a zip code. For example, 70 The Pond, Toronto,,,ON,, M2M1Q5. Please note that one or more commas are used to separate a street name, a city name, a province code and a zip code. At least one comma will precede a group of blank spaces. A city name will never include a white space or a comma. A province code always consists of two or three letters in upper case. A zip code always consists of six alphanumeric characters. (Note: You must use a regular expression to code the static method.)
The following features have already been implemented for the Order class:
The Carrier class is an abstraction of companies that provide delivery service for customer orders. When a Carrier object is created, it is provided with the name of a company (e.g. UPS, DHL Express, Purolator and CanPar). There is no limit on the total number of customer orders that a company can deliver. You can use the Order class from Part A.
You are not required to code a complete Java class. However, you must write down Java code for the following requirements:
Here is a snapshot of a company that has received five customer orders.
Company name: DHL Express
5 customer orders:
Mary Ashton, 123 Green Lane, Thornhill, ON M8W2R4
Peter Kok, 111 Rose, Vancouver, BC E1F4X5
Lisa Kuhn, 467 Brook, Red_Deer, ALB R1W9U2
Paul Chan, 98 Sand, Halton, NFL V1Y4M8
John Doe, 70 The Pond, Toronto, ON M2M1Q5
If the method removeOrders is called with “ON”, it will return an array that has the following two customer orders:
Mary Ashton, 123 Green Lane, Thornhill, ON M8W2R4
John Doe, 70 The Pond, Toronto, ON M2M1Q5
Note: The company has only three customer orders for delivery