Question: Question 4: (4 POINTS: 1 POINT for each class) Design an implementation for PostalCode classes (abstract parent class, the isValid method is abstract), CanadaCode and

Question 4: (4 POINTS: 1 POINT for each class) Design an implementation for PostalCode classes (abstract parent class, the isValid method is abstract), CanadaCode and USCode which are the subclasses Concrete PostalCode. Make sure to include the instance variables as well as the builders. The appendix below presents a summary of the class methods String and Character. Create a Test class to test your classes:  Declare a table, named codes, which can contain 100 postal codes;  Create n = 10 postal codes some of which are US codes while others will be Canadian codes. Likewise, some codes are valid and others are not. Finally, save these codes in the first n cells on the left of the table;  Knowing that exactly n postal codes are in the left part of the table, write a for loop to count the number of valid codes and display it. / Example output * / 2 codes are valid Appendix The String class contains the following methods. char charAt (int pos): returns the character located at the position specified by the index pos; int length (): return the length of this string. The Character class contains the following methods: static boolean isDigit (char ch): determines if the character passed in parameter is a number; static boolean isLetter (char ch): determines if the character passed in parameter is a letter; static boolean isWhitespace (char ch): determines if the character passed in parameter is a white space.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!