In this code I am supposed to enter a 5 character inventory code. The inventory code has a color associated with it and I am supposed to be able to use substr
to access the last two characters in the inventory code. If the inventory code entered does not match it is an "Invalid Inventory Code". If I enter one of the correct codes it tells me the color associated with it but also Invalid inventory code. Not sure if I am missing something or if part of my code might be out of order. Any ideas?
I don't think there is much point in initializing inventCode line 9 with an empty string
Also put angle brackets ( < code > ) round your code
What happens when you run the program?