Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GeographicAreaLookup {
- //method for locating zipcode
- public String determineAreaByZip (char zipCode){
- switch(zipCode){
- case '0': case '1': case '2': case '3':
- return (zipCode + " is in the East Coast.");
- case '4': case '5': case '6':
- return (zipCode + " is in the Central Plains.");
- case '7':
- return (zipCode + "is in the South.");
- case '8': case '9':
- return (zipCode + "is in the West.");
- default:
- return (zipCode +"invalid zipcode.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment