Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This Program is in C++ . TEXT FILE 1 - H - Hydrogen 2 - He - Helium 3 - Li - Lithium 4 -

image text in transcribedimage text in transcribed

This Program is in C++ .

TEXT FILE

1 - H - Hydrogen 2 - He - Helium 3 - Li - Lithium 4 - Be - Beryllium 5 - B - Boron 6 - C - Carbon 7 - N - Nitrogen 8 - O - Oxygen 9 - F - Fluorine 10 - Ne - Neon 11 - Na - Sodium 12 - Mg - Magnesium 13 - Al - Aluminum 14 - Si - Silicon 15 - P - Phosphorus 16 - S - Sulfur 17 - Cl - Chlorine 18 - Ar - Argon 19 - K - Potassium 20 - Ca - Calcium 21 - Sc - Scandium 22 - Ti - Titanium 23 - V - Vanadium 24 - Cr - Chromium 25 - Mn - Manganese 26 - Fe - Iron 27 - Co - Cobalt 28 - Ni - Nickel 29 - Cu - Copper 30 - Zn - Zinc 31 - Ga - Gallium 32 - Ge - Germanium 33 - As - Arsenic 34 - Se - Selenium 35 - Br - Bromine 36 - Kr - Krypton 37 - Rb - Rubidium 38 - Sr - Strontium 39 - Y - Yttrium 40 - Zr - Zirconium 41 - Nb - Niobium 42 - Mo - Molybdenum 43 - Tc - Technetium 44 - Ru - Ruthenium 45 - Rh - Rhodium 46 - Pd - Palladium 47 - Ag - Silver 48 - Cd - Cadmium 49 - In - Indium 50 - Sn - Tin 51 - Sb - Antimony 52 - Te - Tellurium 53 - I - Iodine 54 - Xe - Xenon 55 - Cs - Cesium 56 - Ba - Barium 57 - La - Lanthanum 58 - Ce - Cerium 59 - Pr - Praseodymium 60 - Nd - Neodymium 61 - Pm - Promethium 62 - Sm - Samarium 63 - Eu - Europium 64 - Gd - Gadolinium 65 - Tb - Terbium 66 - Dy - Dysprosium 67 - Ho - Holmium 68 - Er - Erbium 69 - Tm - Thulium 70 - Yb - Ytterbium 71 - Lu - Lutetium 72 - Hf - Hafnium 73 - Ta - Tantalum 74 - W - Tungsten 75 - Re - Rhenium 76 - Os - Osmium 77 - Ir - Iridium 78 - Pt - Platinum 79 - Au - Gold 80 - Hg - Mercury 81 - Tl - Thallium 82 - Pb - Lead 83 - Bi - Bismuth 84 - Po - Polonium 85 - At - Astatine 86 - Rn - Radon 87 - Fr - Francium 88 - Ra - Radium 89 - Ac - Actinium 90 - Th - Thorium 91 - Pa - Protactinium 92 - U - Uranium 93 - Np - Neptunium 94 - Pu - Plutonium 95 - Am - Americium 96 - Cm - Curium 97 - Bk - Berkelium 98 - Cf - Californium 99 - Es - Einsteinium 100 - Fm - Fermium 101 - Md - Mendelevium 102 - No - Nobelium 103 - Lr - Lawrencium 104 - Rf - Rutherfordium 105 - Db - Dubnium 106 - Sg - Seaborgium 107 - Bh - Bohrium 108 - Hs - Hassium 109 - Mt - Meitnerium 110 - Ds - Darmstadtium 111 - Rg - Roentgenium 112 - Cn - Copernicium 113 - Nh - Nihonium 114 - Fl - Flerovium 115 - Mc - Moscovium 116 - Lv - Livermorium 117 - Ts - Tennessine 118 - Og - Oganesson

La rry oleman 1. On the television show Breaking Bad, the opening credits for each episode showed chemical abbreviations in each actor's name. Write a program to Breaking Bad'-ify names. For example, if someone's name was "Breaking Bad", you would output "B_reaking Ba_d", with an underscore following each chemical abbreviation and the element name Boron. The "best" not used element to appear is the one that occurs first alphabetically in each name. Again, the word "Breaking" contains seven possible element abbreviations-B, Re, I, N, K, Br, and In. Only the first in alphabetical order, "B", is used. In the word "Bad", "Ba" is used over "B" since that element was already used and alphabetically comes next. The elements.dat file contains all 118 chemical elements, one on each line. Input the people's name first and last (checking case) from the keyboard. For each name, output the person's first and last name, as shown below, with the "best" chemical abbreviation inserted in each one, using an underscore along with the chemical element information, according to the specifications listed above. If no abbreviation exists for any name, just output the name in its original form and the string "No chemical elements found". Enter the file name from the keyboard. Check for valid files and ask the user to run the program again. Check user input. Use user-defined functions/methods in your program. Do not use break or continue statements. For C++ use the string class; otherwise, use any data structure of your choice. Refer to the sample output below. Sample Run: Sample File (partial): 1 - H - Hydrogen 2 - He - Helium 3 - Li - Lithium 4 - Be - Beryllium 5 - B - Boron Enter the file name: elements.txt Enter a name: James Chegwidden JAm_es C_hegwidden Elements: 95 - Am - Americium 6- C - Carbon Run again(Y/N): y COSC 2436 520 Enter a name: Dae Xaz Dae Xaz No chemical elements found Run again(Y/N): N Name the program: Element GeneratorXX.java or ElementGeneratorXX.cpp, where XX are your initials. La rry oleman 1. On the television show Breaking Bad, the opening credits for each episode showed chemical abbreviations in each actor's name. Write a program to Breaking Bad'-ify names. For example, if someone's name was "Breaking Bad", you would output "B_reaking Ba_d", with an underscore following each chemical abbreviation and the element name Boron. The "best" not used element to appear is the one that occurs first alphabetically in each name. Again, the word "Breaking" contains seven possible element abbreviations-B, Re, I, N, K, Br, and In. Only the first in alphabetical order, "B", is used. In the word "Bad", "Ba" is used over "B" since that element was already used and alphabetically comes next. The elements.dat file contains all 118 chemical elements, one on each line. Input the people's name first and last (checking case) from the keyboard. For each name, output the person's first and last name, as shown below, with the "best" chemical abbreviation inserted in each one, using an underscore along with the chemical element information, according to the specifications listed above. If no abbreviation exists for any name, just output the name in its original form and the string "No chemical elements found". Enter the file name from the keyboard. Check for valid files and ask the user to run the program again. Check user input. Use user-defined functions/methods in your program. Do not use break or continue statements. For C++ use the string class; otherwise, use any data structure of your choice. Refer to the sample output below. Sample Run: Sample File (partial): 1 - H - Hydrogen 2 - He - Helium 3 - Li - Lithium 4 - Be - Beryllium 5 - B - Boron Enter the file name: elements.txt Enter a name: James Chegwidden JAm_es C_hegwidden Elements: 95 - Am - Americium 6- C - Carbon Run again(Y/N): y COSC 2436 520 Enter a name: Dae Xaz Dae Xaz No chemical elements found Run again(Y/N): N Name the program: Element GeneratorXX.java or ElementGeneratorXX.cpp, where XX are your initials

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions