Skip to content

Instantly share code, notes, and snippets.

@pranavgade20
Created June 10, 2019 04:11
Show Gist options
  • Save pranavgade20/072227904227fa253013e6b8d91a15ce to your computer and use it in GitHub Desktop.
Save pranavgade20/072227904227fa253013e6b8d91a15ce to your computer and use it in GitHub Desktop.
A program to print details about elements of the periodic table. A dirty hack thrown together in 30mins. Feel free to plagiarize!
#include <iostream>
std::string names[119] = {"Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Cesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium", "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Nihonium", "Flerovium", "Moscovium", "Livermorium", "Tennessine", "Oganesson", "Ununennium"};
std::string symbols[119] = {"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg", "Cn", "Nh", "Fl", "Mc", "Lv", "Ts", "Og", "Uue"};
std::string melting[119] = {"13.99K", "0.95K", "453.65K", "1560K", "2349K", "Not Available", "63.15K", "54.36K", "53.48K", "24.56K", "370.944K", "923K", "933.47K", "1687K", "Not Available", "388.36K", "171.6K", "83.81K", "336.7K", "1115K", "1814K", "1941K", "2183K", "2180K", "1519K", "1811K", "1768K", "1728K", "1357.77K", "692.68K", "302.9146K", "1211.4K", "Not Available", "494K", "265.8K", "115.78K", "312.45K", "1050K", "1799K", "2128K", "2750K", "2896K", "2430K", "2607K", "2237K", "1828.05K", "1234.93K", "594.22K", "429.7485K", "505.08K", "903.78K", "722.66K", "386.85K", "161.4K", "301.7K", "1000K", "1193K", "1068K", "1208K", "1297K", "1315K", "1345K", "1099K", "1585K", "1629K", "1680K", "1734K", "1802K", "1818K", "1097K", "1925K", "2506K", "3290K", "3695K", "3459K", "3306K", "2719K", "2041.4K", "1337.33K", "234.321K", "577K", "600.61K", "544.7K", "527K", "575K", "202K", "300K", "1233K", "1500K", "2023K", "1841K", "1405.3K", "912K", "912.5K", "1449K", "1613K", "1259K", "1173K", "1133K", "1800K", "1100K", "1100K", "1900K", "2400K", "Not Available", "Not Available", "Not Available", "126K", "Not Available", "Not Available", "Not Available", "Not Available", "700K", "340K", "670K", "709K", "723K", "Not Available", "Not Available"};
std::string boiling[119] = {"20.271K", "4.222K", "1603K", "2742K", "4200K", "Not Available", "77.355K", "90.188K", "85.03K", "27.104K", "1156.09K", "1363K", "2743K", "3538K", "Not Available", "717.8K", "239.11K", "87.302K", "1032K", "1757K", "3109K", "3560K", "3680K", "2944K", "2334K", "3134K", "3200K", "3003K", "2835K", "1180K", "2673K", "3106K", "Not Available", "958K", "332.0K", "119.93K", "961K", "1650K", "3203K", "4650K", "5017K", "4912K", "4538K", "4423K", "3968K", "3236K", "2435K", "1040K", "2345K", "2875K", "1908K", "1261K", "457.4K", "165.051K", "944K", "2118K", "3737K", "3716K", "3403K", "3347K", "3273K", "2173K", "1802K", "3273K", "3396K", "2840K", "2873K", "3141K", "2223K", "1469K", "3675K", "4876K", "5731K", "6203K", "5869K", "5285K", "4403K", "4098K", "3243K", "629.88K", "1746K", "2022K", "1837K", "1235K", "610K", "211.5K", "950K", "2010K", "3500K", "5061K", "4300K", "4404K", "4447K", "3505K", "2880K", "3383K", "2900K", "1743K", "1269K", "Not Available", "Not Available", "Not Available", "Not Available", "5800K", "Not Available", "Not Available", "Not Available", "Not Available", "Not Available", "Not Available", "Not Available", "3570K", "1430K", "420K", "1400K", "1085K", "883K", "350K", "630K"};
std::string appearance[119] = {"colorless gas", "colorless gas, exhibiting a red-orange glow when placed in a high-voltage electric field", "silvery-white", "white-gray metallic", "black-brown", "Unknown", "colorless gas, liquid or solid", "Unknown", "Unknown", "colorless gas exhibiting an orange-red glow when placed in a high voltage electric field", "silvery white metallic", "shiny grey solid", "silvery gray metallic", "crystalline, reflective with bluish-tinged faces", "colourless, waxy white, yellow, scarlet, red, violet, black", "lemon yellow sintered microcrystals", "pale yellow-green gas", "colorless gas exhibiting a lilac/violet glow when placed in a high voltage electric field", "silvery gray", "Unknown", "silvery white", "silvery grey-white metallic", "blue-silver-grey metal", "silvery metallic", "silvery metallic", "lustrous metallic with a grayish tinge", "hard lustrous gray metal", "lustrous, metallic, and silver with a gold tinge", "red-orange metallic luster", "silver-gray", "silver-white", "grayish-white", "metallic grey", "black, red, and gray (not pictured) allotropes", "Unknown", "colorless gas, exhibiting a whitish glow in a high electric field", "grey white", "Unknown", "silvery white", "silvery white", "gray metallic, bluish when oxidized", "gray metallic", "shiny gray metal", "silvery white metallic", "silvery white metallic", "silvery white", "lustrous white metal", "silvery bluish-gray metallic", "silvery lustrous gray", "silvery-white (beta, β) or gray (alpha, α)", "silvery lustrous gray", "Unknown", "lustrous metallic gray, violet as a gas", "colorless gas, exhibiting a blue glow when placed in a high voltage electric field", "silvery gold", "Unknown", "silvery white", "silvery white", "grayish white", "silvery white", "metallic", "silvery white", "Unknown", "silvery white", "silvery white", "silvery white", "silvery white", "silvery white", "silvery gray", "Unknown", "silvery white", "steel gray", "gray blue", "grayish white, lustrous", "silvery-grayish", "silvery, blue cast", "silvery white", "silvery white", "metallic yellow", "silvery", "silvery white", "metallic gray", "lustrous silver", "silvery", "unknown, probably metallic", "colorless gas, occasionally glows green or red in discharge tubes", "Unknown", "silvery white metallic", "Unknown", "silvery, often with black tarnish", "bright, silvery metallic luster", "Unknown", "silvery metallic", "silvery white, tarnishing to dark gray in air", "silvery white", "silvery metallic, glows purple in the dark", "silvery", "silvery", "silver-colored", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown"};
std::string mass[119] = {"1.008", "4.0026022", "6.94", "9.01218315", "10.81", "12.011", "14.007", "15.999", "18.9984031636", "20.17976", "22.989769282", "24.305", "26.98153857", "28.085", "30.9737619985", "32.06", "35.45", "39.9481", "39.09831", "40.0784", "44.9559085", "47.8671", "50.94151", "51.99616", "54.9380443", "55.8452", "58.9331944", "58.69344", "63.5463", "65.382", "69.7231", "72.6308", "74.9215956", "78.9718", "79.904", "83.7982", "85.46783", "87.621", "88.905842", "91.2242", "92.906372", "95.951", "98", "101.072", "102.905502", "106.421", "107.86822", "112.4144", "114.8181", "118.7107", "121.7601", "127.603", "126.904473", "131.2936", "132.905451966", "137.3277", "138.905477", "140.1161", "140.907662", "144.2423", "145", "150.362", "151.9641", "157.253", "158.925352", "162.5001", "164.930332", "167.2593", "168.934222", "173.0451", "174.96681", "178.492", "180.947882", "183.841", "186.2071", "190.233", "192.2173", "195.0849", "196.9665695", "200.5923", "204.38", "207.21", "208.980401", "209", "210", "222", "223", "226", "227", "232.03774", "231.035882", "238.028913", "237", "244", "243", "247", "247", "251", "252", "257", "258", "259", "266", "267", "268", "269", "270", "269", "278", "281", "282", "285", "286", "289", "289", "293", "294", "294", "315"};
std::string category[119] = {"diatomic nonmetal", "noble gas", "alkali metal", "alkaline earth metal", "metalloid", "polyatomic nonmetal", "diatomic nonmetal", "diatomic nonmetal", "diatomic nonmetal", "noble gas", "alkali metal", "alkaline earth metal", "post-transition metal", "metalloid", "polyatomic nonmetal", "polyatomic nonmetal", "diatomic nonmetal", "noble gas", "alkali metal", "alkaline earth metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "post-transition metal", "metalloid", "metalloid", "polyatomic nonmetal", "diatomic nonmetal", "noble gas", "alkali metal", "alkaline earth metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "post-transition metal", "post-transition metal", "metalloid", "metalloid", "diatomic nonmetal", "noble gas", "alkali metal", "alkaline earth metal", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "lanthanide", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "post-transition metal", "post-transition metal", "post-transition metal", "post-transition metal", "metalloid", "noble gas", "alkali metal", "alkaline earth metal", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "actinide", "transition metal", "transition metal", "transition metal", "transition metal", "transition metal", "unknown, probably transition metal", "unknown, probably transition metal", "unknown, probably transition metal", "transition metal", "unknown, probably transition metal", "post-transition metal", "unknown, probably post-transition metal", "unknown, probably post-transition metal", "unknown, probably metalloid", "unknown, predicted to be noble gas", "unknown, but predicted to be an alkali metal"};
std::string density[119] = {"0.08988", "0.1786", "0.534", "1.85", "2.08", "1.821", "1.251", "1.429", "1.696", "0.9002", "0.968", "1.738", "2.7", "2.329", "1.823", "2.07", "3.2", "1.784", "0.862", "1.55", "2.985", "4.506", "6.0", "7.19", "7.21", "7.874", "8.9", "8.908", "8.96", "7.14", "5.91", "5.323", "5.727", "4.81", "3.1028", "3.749", "1.532", "2.64", "4.472", "6.52", "8.57", "10.28", "11", "12.45", "12.41", "12.023", "10.49", "8.65", "7.31", "7.365", "6.697", "6.24", "4.933", "5.894", "1.93", "3.51", "6.162", "6.77", "6.77", "7.01", "7.26", "7.52", "5.264", "7.9", "8.23", "8.54", "8.79", "9.066", "9.32", "6.9", "9.841", "13.31", "16.69", "19.25", "21.02", "22.59", "22.56", "21.45", "19.3", "13.534", "11.85", "11.34", "9.78", "9.196", "6.35", "9.73", "1.87", "5.5", "10", "11.724", "15.37", "19.1", "20.45", "19.816", "12", "13.51", "14.78", "15.1", "8.84", "None", "None", "None", "None", "23.2", "29.3", "35.0", "37.1", "40.7", "37.4", "34.8", "28.7", "23.7", "16", "14", "13.5", "12.9", "7.17", "4.95", "3"};
std::string discovered[119] = {"Henry Cavendish", "Pierre Janssen", "Johan August Arfwedson", "Louis Nicolas Vauquelin", "Joseph Louis Gay-Lussac", "Ancient Egypt", "Daniel Rutherford", "Carl Wilhelm Scheele", "André-Marie Ampère", "Morris Travers", "Humphry Davy", "Joseph Black", "None", "Jöns Jacob Berzelius", "Hennig Brand", "Ancient china", "Carl Wilhelm Scheele", "Lord Rayleigh", "Humphry Davy", "Humphry Davy", "Lars Fredrik Nilson", "William Gregor", "Andrés Manuel del Río", "Louis Nicolas Vauquelin", "Torbern Olof Bergman", "5000 BC", "Georg Brandt", "Axel Fredrik Cronstedt", "Middle East", "India", "Lecoq de Boisbaudran", "Clemens Winkler", "Bronze Age", "Jöns Jakob Berzelius", "Antoine Jérôme Balard", "William Ramsay", "Robert Bunsen", "William Cruickshank (chemist)", "Johan Gadolin", "Martin Heinrich Klaproth", "Charles Hatchett", "Carl Wilhelm Scheele", "Emilio Segrè", "Karl Ernst Claus", "William Hyde Wollaston", "William Hyde Wollaston", "unknown, before 5000 BC", "Karl Samuel Leberecht Hermann", "Ferdinand Reich", "unknown, before 3500 BC", "unknown, before 3000 BC", "Franz-Joseph Müller von Reichenstein", "Bernard Courtois", "William Ramsay", "Robert Bunsen", "Carl Wilhelm Scheele", "Carl Gustaf Mosander", "Martin Heinrich Klaproth", "Carl Auer von Welsbach", "Carl Auer von Welsbach", "Chien Shiung Wu", "Lecoq de Boisbaudran", "Eugène-Anatole Demarçay", "Jean Charles Galissard de Marignac", "Carl Gustaf Mosander", "Lecoq de Boisbaudran", "Marc Delafontaine", "Carl Gustaf Mosander", "Per Teodor Cleve", "Jean Charles Galissard de Marignac", "Georges Urbain", "Dirk Coster", "Anders Gustaf Ekeberg", "Carl Wilhelm Scheele", "Masataka Ogawa", "Smithson Tennant", "Smithson Tennant", "Antonio de Ulloa", "Middle East", "unknown, before 2000 BCE", "William Crookes", "Middle East", "Claude François Geoffroy", "Pierre Curie", "Dale R. Corson", "Friedrich Ernst Dorn", "Marguerite Perey", "Pierre Curie", "Friedrich Oskar Giesel", "Jöns Jakob Berzelius", "William Crookes", "Martin Heinrich Klaproth", "Edwin McMillan", "Glenn T. Seaborg", "Glenn T. Seaborg", "Glenn T. Seaborg", "Lawrence Berkeley National Laboratory", "Lawrence Berkeley National Laboratory", "Lawrence Berkeley National Laboratory", "Lawrence Berkeley National Laboratory", "Lawrence Berkeley National Laboratory", "Joint Institute for Nuclear Research", "Lawrence Berkeley National Laboratory", "Joint Institute for Nuclear Research", "Joint Institute for Nuclear Research", "Lawrence Berkeley National Laboratory", "Gesellschaft für Schwerionenforschung", "Gesellschaft für Schwerionenforschung", "Gesellschaft für Schwerionenforschung", "Gesellschaft für Schwerionenforschung", "Gesellschaft für Schwerionenforschung", "Gesellschaft für Schwerionenforschung", "RIKEN", "Joint Institute for Nuclear Research", "Joint Institute for Nuclear Research", "Joint Institute for Nuclear Research", "Joint Institute for Nuclear Research", "Joint Institute for Nuclear Research", "GSI Helmholtz Centre for Heavy Ion Research"};
std::string phase[119] = {"Gas", "Gas", "Solid", "Solid", "Solid", "Solid", "Gas", "Gas", "Gas", "Gas", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Gas", "Gas", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Liquid", "Gas", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Gas", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Liquid", "Solid", "Solid", "Solid", "Solid", "Solid", "Gas", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Gas", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid", "Solid"};
int main(int argc, char const *argv[])
{
for (int i = 0; i < 119; ++i)
{
std::cout << i << ": " << std::endl;
std::cout << symbols[i] << std::endl;
std::cout << names[i] << std::endl;
std::cout << melting[i] << std::endl;
std::cout << boiling[i] << std::endl;
std::cout << appearance[i] << std::endl;
std::cout << mass[i] << std::endl;
std::cout << category[i] << std::endl;
std::cout << density[i] << std::endl;
std::cout << discovered[i] << std::endl;
std::cout << phase[i] << std::endl;
std::cout << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment