Question

Write a program to get the electron configuration, given the atomic number. Assume that elements atomic...

Write a program to get the electron configuration, given the atomic number. Assume that elements atomic numbers are between 1 to 118. Any programming language is fine but Java or Python is preferred.

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;
}
}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

public 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 arr[] = {"", "1S1", "1S2", "[He]2s1", "[He]2s2", "[He]2s22p1", "[He]2s22p2", "[He]2s22p3", "[He]2s22p4",
               "[He]2s22p5", "[He]2s22p6", "[Ne]3s1", "[Ne]3s2", "[Ne]3s23p1", "[Ne]3s23p2", "[Ne]3s23p3",
               "[Ne]3s23p4", "[Ne]3s23p5", "[Ne]3s23p6", "[Ar]4s1", "[Ar]4s2", "[Ar]3d14s2", "[Ar]3d24s2",
               "[Ar]3d34s2", "[Ar]3d54s1", "[Ar]3d54s2", "[Ar]3d64s2", "[Ar]3d74s2", "[Ar]3d84s2", "[Ar]3d104s1",
               "[Ar]3d104s2", "[Ar]3d104s24p1", "[Ar]3d104s24p2", "[Ar]3d104s24p3", "[Ar]3d104s24p4", "[Ar]3d104s24p5",
               "[Ar]3d104s24p6", "[Kr]5s1", "[Kr]5s2", "[Kr]4d15s2", "[Kr]4d25s2", "[Kr]4d45s1", "[Kr]4d55s1",
               "[Kr]4d55s2", "[Kr]4d75s1", "[Kr]4d85s1", "[Kr]4d10", "[Kr]4d105s1", "[Kr]4d105s2", "[Kr]4d105s25p1",
               "[Kr]4d105s25p2", "[Kr]4d105s25p3", "[Kr]4d105s25p4", "[Kr]4d105s25p5", "[Kr]4d105s25p6", "[Xe]6s1",
               "[Xe]6s2", "[Xe]5d16s2", "[Xe]4f15d16s2", "[Xe]4f36s2", "[Xe]4f46s2", "[Xe]4f56s2", "[Xe]4f66s2",
               "[Xe]4f76s2", "[Xe]4f75d16s2", "[Xe]4f96s2", "[Xe]4f106s2", "[Xe]4f116s2", "[Xe]4f126s2", "[Xe]4f136s2",
               "[Xe]4f146s2", "[Xe]4f145d16s2", "[Xe]4f145d26s2", "[Xe]4f145d36s2", "[Xe]4f145d46s2", "[Xe]4f145d56s2",
               "[Xe]4f145d66s2", "[Xe]4f145d76s2", "[Xe]4f145d96s1", "[Xe]4f145d106s1", "[Xe]4f145d106s2",
               "[Xe]4f145d106s26p1", "[Xe]4f145d106s26p2", "[Xe]4f145d106s26p3", "[Xe]4f145d106s26p4",
               "[Xe]4f145d106s26p5", "[Xe]4f145d106s26p6", "[Rn]7s1", "[Rn]7s2", "[Rn]6d17s2", "[Rn]6d27s2",
               "[Rn]5f26d17s2", "[Rn]5f36d17s2", "[Rn]5f46d17s2", "[Rn]5f67s2", "[Rn]5f77s2", "[Rn]5f76d17s2",
               "[Rn]5f97s2", "[Rn]5f107s2", "[Rn]5f117s2", "[Rn]5f127s2", "[Rn]5f137s2", "[Rn]5f147s2",
               "[Rn]5f147s27p1", "[Rn]5f146d27s2", "*[Rn]5f146d37s2", "*[Rn]5f146d47s2", "*[Rn]5f146d57s2",
               "*[Rn]5f146d67s2", "*[Rn]5f146d77s2", "*[Rn]5f146d97s1", "*[Rn]5f146d107s1", "*[Rn]5f146d107s2",
               "*[Rn]5f146d107s27p1", "*[Rn]5f146d107s27p2", "*[Rn]5f146d107s27p3", "*[Rn]5f146d107s27p4",
               "*[Rn]5f146d107s27p5", "*[Rn]5f146d107s27p6" };

       String result = arr[atomicNumber];

//Write code here to get the electronic configuration
       return result;
   }
}

<terminated > ElectronConfiguration Java Applica [Ar]4s2

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
Write a program to get the electron configuration, given the atomic number. Assume that elements atomic...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program in Java that prompts a user for Name and id number. and then...

    Write a program in Java that prompts a user for Name and id number. and then the program outputs students GPA MAIN import java.util.StringTokenizer; import javax.swing.JOptionPane; public class Main {    public static void main(String[] args) {                       String thedata = JOptionPane.showInputDialog(null, "Please type in Student Name. ", "Student OOP Program", JOptionPane.INFORMATION_MESSAGE);        String name = thedata;        Student pupil = new Student(name);                   //add code here       ...

  • Problem 1 Given a linked list of integers, write a function getUnique that removes all duplicates elements in the linked list and returns the new linked list of unique elements (The order does not ma...

    Problem 1 Given a linked list of integers, write a function getUnique that removes all duplicates elements in the linked list and returns the new linked list of unique elements (The order does not matter). Example: Input: 1-»2->3->1-2 Output: 1->2->3 public class Node f int iterm Node next; Node(int d) t item = d; next-null; ) import java.util.ArrayList; public class ExtraLab public static void main (String[] args)t PROBLEM 1 System.out.println("PROBLEM 1"); Node head new Node(1); head.next-new Node (2); head.next.next-new Node(3);...

  • JAVA HELP: Directions Write a program that will create an array of random numbers and output...

    JAVA HELP: Directions Write a program that will create an array of random numbers and output the values. Then output the values in the array backwards. Here is my code, I am having a problem with the second method. import java.util.Scanner; import java.util.Random; public class ArrayBackwards { public static void main(String[] args) { genrate(); print(); } public static void generate() { Scanner scanner = new Scanner(System.in);    System.out.println("Seed:"); int seed = scanner.nextInt();    System.out.println("Length"); int length = scanner.nextInt(); Random random...

  • 1) Consider the following Java program: 1 public class HelloWorld { 2     // My first program!...

    1) Consider the following Java program: 1 public class HelloWorld { 2     // My first program! 3     public static void main(String[] args) { 4         System.out.println("Hello, World!"); 5     } 6 } What is on line 1? a. a variable declaration b. a statement c. a method (subroutine) definition d. a comment e. a class definition 2) Which one of the following does NOT describe an array? a. It can be used in a for-each loop. b. It has a numbered sequence...

  • Write a program that will check a Java file for syntax errors. The program will ask...

    Write a program that will check a Java file for syntax errors. The program will ask for an input-file name and output-file name and will then copy all the code from the Java input file to the Java output file, but with the following changes: 1. Any syntax error found in the Java input file will be corrected: a. Missing semicolon b. Missing compound statements (curly braces) c. All comments have to start with // and end with a period....

  • Filename(s): ReformatCode. java Public class: ReformatCode Package-visible class(es): none Write a program that reformats Java source...

    Filename(s): ReformatCode. java Public class: ReformatCode Package-visible class(es): none Write a program that reformats Java source code from the next-line brace style to the end-of-line brace style. The program is invoked from the command line with the input Java source code file as args [0] and the name of the file to save the formatted code in as args [1]. The original file is left untouched. The program makes no other changes the source code, including whitespace. For example, the...

  • Consider the following short program. If there's an error (either compilation or runtime) in the program,...

    Consider the following short program. If there's an error (either compilation or runtime) in the program, then tell me what the problem is. But if the program works fine, then describe in 1 or 2 sentences what's the goal of the program. public class Main { public static void main(String[] args) { String[] arr = args; m(arr); public static void m(String... a) { for (int i = 0; i < a.length; i++) System.out.println(a[i] + a[i]);

  • What is the output of this program? class A { public int i; private int j;...

    What is the output of this program? class A { public int i; private int j; } class B extends A { void display() { super.j = super.i + 1; System.out.println(super.i + " " + super.j); } } class Inheritance { public static void main(String args[]) { B obj = new B(); obj.i=1; obj.j=2; obj.display(); } } Java language!! // include explanation!

  • Question 1 8 pts Write all the different possible outputs of the following Java multi-threaded program:...

    Question 1 8 pts Write all the different possible outputs of the following Java multi-threaded program: class MultithreadingDemo extends Thread public void runot try{ System.out.println (--Multithread.countDown): catch (Exception e) w public class Multithread{ public static int countDown = 10; public static void main(String[] args) { for (int i = 0; i < 3; i++) { MultithreadingDemo object = new MultithreadingDemol); object.start(); } میه

  • JAVA PROGRAMMING Given main(), complete the SongNode class to include the printSongInfo() method. Then write the...

    JAVA PROGRAMMING Given main(), complete the SongNode class to include the printSongInfo() method. Then write the Playlist class' printPlaylist() method to print all songs in the playlist. DO NOT print the dummy head node. Ex: If the input is: Stomp! 380 The Brothers Johnson The Dude 337 Quincy Jones You Don't Own Me 151 Lesley Gore -1 the output is: LIST OF SONGS ------------- Title: Stomp! Length: 380 Artist: The Brothers Johnson Title: The Dude Length: 337 Artist: Quincy Jones...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT