Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Chemistry class, you learned about the different orbits of electrons of an atom and how they are arranged in different patterns. There is the
In Chemistry class, you learned about the different orbits of electrons of an atom and how they are arranged in different patterns. There is the sorbital which holds electrons, the porbital which holds the dorbital which holds etc. There is a chart of electron orbitals to understand how they are populated for a specific atom. Additionally, there is a pattern to how the electrons fill the orbitals. See the following diagram below.
The rules for filling in the electron orbitals is to follow the diagonals. The electrons will fill in the first orbital before moving to the next. As shown in the diagram, the order of the orbitals is as follows: sspspsdpsdpsfdpsfdp For example, Sodium atomic # will first fill in the two electrons in the s orbital, then the next two electrons in the s orbital, the next six in the p orbital, and finally the last one in the s orbital.
Write a C program to prompt the user for an atomic number, and the program will print out the electron orbital chart for that element. If the user enters a number outside the periodic chart eg above give an error message of "Number is outside the range of atomic numbers." and exit. The output will be an orbital chart, where each entry will contain the orbit number followed by the orbital type s p d f and finally the number of electrons that are in that orbital. If the final orbital is not fully populated, it should print the actual number of electrons there, not the total possible. See below for some sample output runs.
Notes:
You must use nested loops for this program No hardcoding with printf statements
Since we have not yet learned about arrays or the string library, you cannot use them for this assignment.
To make printing easier, you may put a space after each entry. egs
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