Given the atomic number get the electron configuration - Java Quiz Question



Write a program to get the electron configuration, given the atomic number. Assume that elements atomic numbers are between 1 to 118.

Input (int) Output (String)
0 null
1 1s^1
15 1s^2 2s^2 2p^6 3s^2 3p^3
37 1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10 4p^6 5s^1
50 1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10 4p^6 5s^2 4d^10 5p^2
83 1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10 4p^6 5s^2 4d^10 5p^6 6s^2 4f^14 5d^10 6p^3
118 1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10 4p^6 5s^2 4d^10 5p^6 6s^2 4f^14 5d^10 6p^6 7s^2 5f^14 6d^10 7p^6
119 null

class ElectronConfiguration

{    public static void main(String s[])
    {
        int atomicNumber = 20;
        String electronConfiguration = getElectronConfiguration(atomicNumber);
        System.out.println(electronConfiguration);

    }


public static String getElectronConfiguration(int atomicNumber) {
String result = null;
//Write code here to get the electronic configuration
return result;
}
}