Answered step by step
Verified Expert Solution
Link Copied!

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 s-orbital which holds 2 electrons, the p-orbital which holds 6, the d-orbital which holds 10, 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: 1s,2s,2p,3s,3p,4s,3d,4p,5s,4d,5p,6s,4f,5d,6p,7s,5f,6d,7p. For example, Sodium (atomic #11), will first fill in the two electrons in the 1s orbital, then the next two electrons in the 2s orbital, the next six in the 2p orbital, and finally the last one in the 3s 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 (e.g. above 118) 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 (1-7) 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 7 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. (e.g."1s2_")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

What is an audit and why is it important?

Answered: 1 week ago