Answered step by step
Verified Expert Solution
Question
1 Approved Answer
lab2.2zipcode.txt (this is what is held in the file)so you can copy and make one yourself. 07024 23503 l0045 2792 1500z 11566 327922 53190 43035
lab2.2zipcode.txt (this is what is held in the file)so you can copy and make one yourself.
07024 23503 l0045 2792 1500z 11566 327922 53190 43035 84119
Lab2.2 Validate Zip Code_version-2 [50pts]: Write a Java program to read in zip code from a text file (.txt file) named "lab2.2zipcode" (download this text file from assignment dropbox). The program will validate each zip code read in from the text file "lab2.2zipcode", to check if each of those zip codes is a valid zip code or not. A valid zip code should contain 5 digits (e.g., 53190), and each digit should within the range 0-9. (Hint: you may use the same validation process implemented in the in-class practice 3.1] At the end, the program will display which zip codes are invalid zip codes, which are valid zip codes in console, and how many of them. The output should look like as follows (Note: the following is just an example showing the format of outputs, not the actual outputs from the program): The zip codes read in from the file are: 53190, 44091, 00541... There are 3 invalid zip codes, and 7 valid zip codesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started