Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
In Java, a definition for an atom class that contains:
- fields for storing the numbers of protons, neutrons and electrons with appropriate visibility;
- 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 [Make use of if statement];
- a constructor that initializes new objects of atom to be the smallest element (Hydrogen), for which the number ofprotonsis 1, the number ofneutrons is 0, and the number of electrons is 1.
- 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).
- 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 is defined as the number of protons plus the number of neutrons.
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