question archive In chemistry, Atom is the simplest particle of element

In chemistry, Atom is the simplest particle of element

Subject:Computer SciencePrice: Bought3

In chemistry, Atom is the simplest particle of element. Each atom contains electron (-ve charged particles), protons (+ve charged particles) and neutrons (no charge). Atomic number is sum of electrons and protons, while atomic mass number is the sum of protons and neutrons. An atom is ion if electrons and protons are not equal. If electrons are more than protons then the ion is anion, otherwise cation.
Create a class Atom with data members number of electrons, protons and neutrons. As the simplest atom of hydrogen contains one electron, one proton, and no neutron, so in default constructor new object of this class should be initialized like hydrogen atom as explained above. The Atom class should contain get() to assign values to electrons, protons and neutrons. It also contain isIon(), which returns a Boolean value true or false. An Atom is ion if number of electrons and protons are unequal. If atom is ion then it may be anion or cation. The atom is anion if it has more electrons than protons (e>p), and cation if protons are more than electrons. This class should also show that whether the given atom is anion or cation and what is the amount of charge ( if an atom with e=15, p=13, n=16; then it is anion with charge -2 i.e. (e-p=2); if an atom with e=15, p=18, n=16; then it is cation with charge +3 i.e. (pe=3)). The class should contain a getAtomicNumber() to return the atomic number (protons + electrons) of the atom and getAtomicMassNumber() to return the atomic mass (protons+neutrons) of the atom. Also highlight mutator and accessors in the class. There should be NO inline constructor or function. In main() create 3 objects of the class and assign e, p and n using get(). Then check whether the object is ion or not, if it's ion what is its type and charge. Also call getAtomicNumber() and getAtomicMassNumber() for all objects to show the atomic number and atomic mass number of each object.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE