Question: IN JAVA Description: Create a program PeriodicTable that will read information about elements in the periodic table (PT) and allow the user to query information
IN JAVA
Description:
Create a program PeriodicTable that will read information about elements in the periodic table (PT) and allow
the user to query information in the PT. The operations to be supported are:
java PeriodicTable [option]
where option can be:
1.
None or more than 1 args output Periodic Table by F. Last
2.
print output the entire PT
3.
a number find the element with the atomic number
4.
an abbreviation find the element with the abbreviation
5.
name find the element starts with name
Your program must:
1.
Define a type Element that has the fields: atomic number, abbreviation, name, and mass
2.
Define a method loadTable that uses ArrayList to read the PT information from the file and return an array of this table.
3.
Define a method printTable that print the PT using the required format (2).
4.
Define methods findAtomicNumber, findAbbreviation, and findName, to search for an atomic number, an
abbreviation, and name and return an index in the PT if found, otherwise -1. Abbreviation and name
searches are case insensitive.
5.
Define a method printElement that print out an element using the required format (3). This method must
be used by 3 and 2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
