Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Define a structure type element_t to represent one element from the periodic table of elements. Components should include the atomic number (an integer); chemical symbol,
Define a structure type element_t to represent one element from the periodic table of elements. Components should include the atomic number (an integer); chemical symbol, the name, and class (strings).
Write separate subroutines(functions) using C program to (1) Read the periodic table from file and store them in structure array (2) find out the elements in each class (3) print out the name of the distinct classes and the elements in each of them in an output file.
Here's the .txt file given:
atomic number symbol atomic mass name class 1 H 1.00794 Hydrogen nonmetal 2 He 4.002602 Helium noble gas 3 Li 6.941 Lithium alkali metal 4 Be 9.012182 Beryllium alkaline earth metal 5 B 10.811 Boron metalloid 6 C 12.0107 Carbon nonmetal 7 N 14.0067 Nitrogen nonmetal 8 O 15.9994 Oxygen nonmetal 9 F 18.9984032 Fluorine halogen 10 Ne 20.1797 Neon noble gas 11 Na 22.98976928 Sodium alkali metal 12 Mg 24.305 Magnesium alkaline earth metal 13 Al 26.9815386 Aluminum metal 14 Si 28.0855 Silicon metalloid 15 P 30.973762 Phosphorus nonmetal 16 S 32.065 Sulfur nonmetal 17 Cl 35.453 Chlorine halogen 18 Ar 39.948 Argon noble gas 19 K 39.0983 Potassium alkali metal 20 Ca 40.078 Calcium alkaline earth metal 21 Sc 44.955912 Scandium transition metal 22 Ti 47.867 Titanium transition metal 23 V 50.9415 Vanadium transition metal 24 Cr 51.9961 Chromium transition metal 25 Mn 54.938045 Manganese transition metal 26 Fe 55.845 Iron transition metal 27 Co 58.933195 Cobalt transition metal 28 Ni 58.6934 Nickel transition metal 29 Cu 63.546 Copper transition metal 30 Zn 65.38 Zinc transition metal 31 Ga 69.723 Gallium metal 32 Ge 72.64 Germanium metalloid 33 As 74.9216 Arsenic metalloid 34 Se 78.96 Selenium nonmetal 35 Br 79.904 Bromine halogen 36 Kr 83.798 Krypton noble gas 37 Rb 85.4678 Rubidium alkali metal 38 Sr 87.62 Strontium alkaline earth metal 39 Y 88.90585 Yttrium transition metal 40 Zr 91.224 Zirconium transition metal 41 Nb 92.90638 Niobium transition metal 42 Mo 95.96 Molybdenum transition metal 43 Tc 98 Technetium transition metal 44 Ru 101.07 Ruthenium transition metal 45 Rh 102.9055 Rhodium transition metal 46 Pd 106.42 Palladium transition metal 47 Ag 107.8682 Silver transition metal 48 Cd 112.411 Cadmium transition metal 49 In 114.818 Indium metal 50 Sn 118.71 Tin metal 51 Sb 121.76 Antimony metalloid 52 Te 127.6 Tellurium metalloid 53 I 126.90447 Iodine halogen 54 Xe 131.293 Xenon noble gas 55 Cs 132.9054519 Cesium alkali metal 56 Ba 137.327 Barium alkaline earth metal 57 La 138.90547 Lanthanum lanthanoid 58 Ce 140.116 Cerium lanthanoid 59 Pr 140.90765 Praseodymium lanthanoid 60 Nd 144.242 Neodymium lanthanoid 61 Pm 145 Promethium lanthanoid 62 Sm 150.36 Samarium lanthanoid 63 Eu 151.964 Europium lanthanoid 64 Gd 157.25 Gadolinium lanthanoid 65 Tb 158.92535 Terbium lanthanoid 66 Dy 162.5 Dysprosium lanthanoid 67 Ho 164.93032 Holmium lanthanoid 68 Er 167.259 Erbium lanthanoid 69 Tm 168.93421 Thulium lanthanoid 70 Yb 173.054 Ytterbium lanthanoid 71 Lu 174.9668 Lutetium transition metal 72 Hf 178.49 Hafnium transition metal 73 Ta 180.94788 Tantalum transition metal 74 W 183.84 Tungsten transition metal 75 Re 186.207 Rhenium transition metal 76 Os 190.23 Osmium transition metal 77 Ir 192.217 Iridium transition metal 78 Pt 195.084 Platinum transition metal 79 Au 196.966569 Gold transition metal 80 Hg 200.59 Mercury transition metal 81 Tl 204.3833 Thallium metal 82 Pb 207.2 Lead metal 83 Bi 208.9804 Bismuth metal 84 Po 209 Polonium metalloid 85 At 210 Astatine halogen 86 Rn 222 Radon noble gas 87 Fr 223 Francium alkali metal 88 Ra 226 Radium alkaline earth metal 89 Ac 227 Actinium actinoid 90 Th 232.03806 Thorium actinoid 91 Pa 231.03588 Protactinium actinoid 92 U 238.02891 Uranium actinoid 93 Np 237 Neptunium actinoid 94 Pu 244 Plutonium actinoid 95 Am 243 Americium actinoid 96 Cm 247 Curium actinoid 97 Bk 247 Berkelium actinoid 98 Cf 251 Californium actinoid 99 Es 252 Einsteinium actinoid 100 Fm 257 Fermium actinoid 101 Md 258 Mendelevium actinoid 102 No 259 Nobelium actinoid 103 Lr 262 Lawrencium transition metal 104 Rf 267 Rutherfordium transition metal 105 Db 268 Dubnium transition metal 106 Sg 271 Seaborgium transition metal 107 Bh 272 Bohrium transition metal 108 Hs 270 Hassium transition metal 109 Mt 276 Meitnerium transition metal 110 Ds 281 Darmstadtium transition metal 111 Rg 280 Roentgenium transition metal 112 Cn 285 Copernicium transition metal 113 Uut 284 Ununtrium metal 114 Uuq 289 Ununquadium metal 115 Uup 288 Ununpentium halogen 116 Uuh 293 Ununhexium noble gas 117 Uus 294 Ununseptium alkali metal 118 Uuo 294 Ununoctium alkaline earth metal
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started