Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design and implement a Class named Postal that represents information for a postal customer Voting a first name, last name and integer representing a zip

Design and implement a Class named Postal that represents information for a postal customer Voting a first name, last name and integer representing a zip code Provide a constructor that accepts the first name, last name, and zip code as parameters Provide getters and setters and a toString method representing a String description for a Prostal object. Develop a driver class named PostalList with a main. method that continually prompts a user (until instructed to stop) to enter postal information including the lust name, last name, and zip code Store the postal information for each entry in an array of up to 10 Poste: objects Note you must use an array (e g not an ArrayList) Alter the information has been input and stored. print the total number of Postal objects stored followed by the String representation of each object as sham, in the example session below Note that your zip code must be formatted to print as a 5 digit integer even if the user entered less Than 5 digits.

Enter firstname lastname zip-code: 'airy Seinfeid 23876

Continue) (y/n): y

Enter firstname lastname zip-code: George Costanza 87623

Continue) (y/n): y

Enter firstname lastname zip-code: Elaine genes 23

Continue? (yin): n

Total number of Postal objects: 3

Jerry Seinfeld 23876

George Costanza 87623

Elaine Banes 00021

Step by Step Solution

3.28 Rating (128 Votes )

There are 3 Steps involved in it

Step: 1

package Array import javautilScanner Defines a class Postal to store a person postal information class Postal Instance variable to store first name la... blur-text-image

Get Instant Access with AI-Powered 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

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions

Question

Looking ahead, what are the biggest risks to their venture?

Answered: 1 week ago