I want to make a program, which first takes one license plate which is supposed to be mine and then three other license plates which are from others.
Now, the program should output, how many cars are more modern and how many are older. Obviously, vocals are not allowed...
I think creating an algorithm for this problem is easy. I just have to transform the chars into numbers so I can make a if method. But I don't certainly know how to make such thing. Maybe someone has an idea?
I think the OP means if his license plate is 'BBM-7878' and one of the others is, say, 'BBN-6541', then that one comes after his plate, so would be newer, but a plate with 'BBL-8745', comes before his plate, so would be older.
If a license plate is more modern, at least in Spain, the numbers and letters have to increase.
The spanish plates have this format: int,int,int,int,letter,letter,letter. For example, 0001 BBB is older than 0001 BBC.
modern has nothing to do with it, its just a specific rule in your country.
ok, we can work with that.
have you tried just sorting them as strings? that looks like it would work, to me, in ascii at least. normal sort is old to new, reverse for newest on top, etc
There's also going to be an issue with custom license plates. It's also possible for people to get a license plate of their choosing while being a non-custom license plate - they can choose out of a list of random available license plate numbers available if they ask and the person is nice.
This program would be extremely easy if you had access to the database that police use to check license plate numbers!
It isn't just custom plates that can be an issue. In the US each state has a long history of changing serial formatting along with basic layouts such as color of lettering and background.
Yea, in the U.S. in particular every state will have a different license plate numbering system and design. States can also change designs every now and then.
I just have to transform the chars into numbers so I can make a if method.
Without knowing anything about the format you are trying to decode makes it almost impossible for anyone to give you a hint of how to proceed.
If the format is mixed letters and numbers that would yield an algorithm that is entirely different and more complex than if the format is straight numbers. Just numbers would be almost insanely easy.
Or just ignore the example. I want to say, which number and char groups of a group(int,int,int,int,letter,letter,letter) are more advanced. Take this examples:
-1234 CCB >1233 CCB
-1234 CCC >1234 CCB
-1111 BTB >1111 BBT
-3333 YYY >3333 XZZ
Ok now wrap this thread boring as batshit thread up yabi. There’s nothing more to drain out of this rubbish now that you have an answer and wasted 2 days of our time. Green tick.