GROUP WORK PROBLEM – PERIODIC TABLE SYMBOLS

 

Note:  When this page was initially created, this problem was going to be Program #6 on the Java 12 website.  But its solution seems to better work in line with an simple introduction to search trees and how they can be used for decision making.



ICS 4U – PROGRAM 06
WORDS AS ELEMENTS

SYMBOLS IN THE PERIODIC TABLE

 

The periodic table contains over a hundred elements each having a symbol.  For example, the symbol for Helium is He while the symbol for Gold is Au.  Note that symbols can contain one letter or two letters.  The first letter is always in upper case and any second letter is already in lower case.

 

In recent years, it has become a common trend to spell word using the symbols of the periodic table.  See the image below for an example.

 

 

TASK DESCRIPTION

 

You will write a program that gets a word (or series of words) and finds all possible combinations of symbols to create the word.  In many cases, there will be no solutions.


SOURCE DATA

 

Click here for a text file containing information from the periodic table.

 

STARTING CODE

 

Click here and here for two classes that get you started with reading the data from the file.

 

 

SAMPLE I/O

 

Enter a word

genius

 

Solutions

GeNIUS

GeNiUS