Question: Write a class called CheckPostCode. The class will ask the user to input a String value, via the keyboard. The class must have the

Write a class called CheckPostCode. The class will ask the user to input a String value, via the keyboard. The class must have the required methods to check if the entered value meets the following criteria: Must be exactly 4 characters in length, anything greater than or less than is invalid Must be all numeric characters only Must classify them based on the first digit as follows: o if first digit is 0, then NT if first digit is 2, then NSW o if first digit is 3, then VIC o if first digit is 4, then QLD o if first digit is 5, then SA o if first digit is 6, then WA o if first digit is 7, then TAS Your class must display the correct state classification based on the above rules. If anytime a rule is not met, it must display the message INVALID POSTCODE to the user. You must also use a loop to do this, as the user may want to check multiple postcodes. You may decide the exit condition for the user to exit the program, such as 0000 or EXIT or anthing similar. Last, remember to write your code as reusable methods. Have you seen or written some other methods before that might be reusable here?
Step by Step Solution
3.48 Rating (151 Votes )
There are 3 Steps involved in it
java import javautilScanner public class CheckPostCode public static void mainString args Scanner sc... View full answer
Get step-by-step solutions from verified subject matter experts
