Find an element in the periodic table.
In 1869 Russian chemist Dimitri Mendeleev started the development of the periodic table, arranging chemical elements by atomic mass. He predicted the discovery of other elements, and left spaces open in his periodic table for them.
⭐⭐⭐
Write a program that allows the user to enter the symbol or name of an element. The program outputs the name of the element, the atomic weight and the group of elements it belongs to using the data in the table below.
Remember to add a comment before a subprogram or selection statement to explain its purpose.
periodic_table that:| Symbol | Element | Atomic weight | Group |
|---|---|---|---|
| Li | Lithium | 6.94 | Alkali metals |
| Na | Sodium | 22.99 | Alkali metals |
| K | Potassium | 39.098 | Alkali metals |
| F | Fluorine | 18.998 | Halogens |
| Cl | Chlorine | 35.45 | Halogens |
| Br | Bromine | 79.904 | Halogens |
main program so that:periodic_table subprogram to output the relevant data.Enter the symbol or name of an element: K
Symbol: K
Element: Potassium
Atomic weight: 39.098
Group: Alkali metals
Enter the symbol or name of an element: Chlorine
Symbol: Cl
Element: Chlorine
Atomic weight: 35.45
Group: Halogens