The atoms of different elements have different numbers of protons, neutrons and electrons. Electrons are negatively charged; protons are positively charged and neutrons have no charge. Write a...


The atoms of different elements have different numbers of protons, neutrons and electrons. Electrons are negatively charged; protons are positively charged and neutrons have no charge.



  1. Write a definition for an
    atom class
    that contains:

    1. Fields for storing the numbers of
      protons, neutrons and electrons
      with appropriate
      visibility;


    2. Setter and getter
      methods for manipulating these fields, ensuring that the minimum value for
      electrons and protons is 1, and the minimum value for
      neutrons is 0;

    3. A
      constructor
      that initializes new objects of atom to be the smallest element (Hydrogen), for which the number of protons is 1, the number of neutrons is 0, and the number of electrons is 1.



  2. Write a new method for the atom class called
    ision
    that will return
    true or false, depending upon whether the
    atom is an ion. An atom is an ion if it is charged (i.e., if the number of electrons ≠ the number of protons).

  3. Write a new method for the atom class called
    getAtomicMassNumber
    that will calculate and
    return the atomic mass number
    of the atom. Atomic mass number of an atom (often denoted A) is defined as the number of protons plus the number of neutrons.)



Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here