The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Re: Help with Java assignment

Posted by Hiran on October 25, 2001 at 4:52 AM

> Dear Friends,

> I would appreciate if you could give me a hand with this assignment.
> It consists of creating a Java program that identifies a full car registration mark as a string.

> For example DF27 TRF

> The first letter indicates the zone where it was registered, the second letter indicates a city within that zone.
> The two numbers after indicate a year and a month, according to a table.
> The three last letters are irrelevant.

> The program must be able to identify the zone, city and date from any car registration.

> I have a list of zones, cities and dates, but have no idea on what method to use or how to start the programing.

> I would appreciate if you could give me any information on what I need to do to make this program.

> Thank you.

> P.

If you are asking how to go about parsing the string and identifying the zone, city and dates, here is one possible way. Since the registration is a string, you could create 4 substrings that hold the zone, city, and two date values from the registration string. You could do this using the substring method from the String class (look in the Java Documentation for details). Then, you could just create four methods that take each substring and check the respective list to find a match. If you need any further help, just post ur specific question and any code that u've gotten so far.
Hiran



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us