Im writing some software for a friends Pc repair shop, simple booking in software so he has a record of customers, addresses and repairs they have had done. I'm getting throught it quite well thanks to members of this forum.
Question is:
I have a Customer class with attributes String surname,String firstName, String street, String town, String postCode and String phone and a Repair class with the attribute String repair. Each Customer also holds a List of Repair objects.
But now he wants each Repair to have a unique refference number, so I will change it so that Customer holds a map of type <String, Repair>.
How can I get the program to give each Repair a unique key(first 3 letters of surname followed by some numerical digits)?
Thanks for looking. I hope I have been clear enough on this!