Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 codes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

3. What may be the goal of the team?

Answered: 1 week ago

Question

Is how things are said consistent with what is said?

Answered: 1 week ago