(Gaming) Your company is working on a game that includes a character, Sammie, whose name changes each time the character finds or loses a gem. When Sammie finds an opal and then finds a ruby, for example, its name changes first to SammieOpal and then to SammieOpalRuby. If SammieOpalRuby loses the opal, its name changes to SammieRuby. The gems used in the game are opal, ruby, emerald, onyx, sapphire, jade, and peridot. Implement a class Sammi Name that uses a linked chain to represent Sammie’s name. The class should provide methods for appending a gem to the name, removing a gem from the name, and returning the current name as a string.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here