


I'm planning out the logical progression on paper before I start writing code, and the problem I foresee myself having is this:Īs soon as you get the ratio, where the lowest one is 1.00, and say the other is 1.33 - How can the computer figure out what to multiply to simplify it? How can you let the computer know "if its about 1/3, then multiply it by 3, if its about 3/4 multiply it by 4, etc.," Because I think it would be improbable to check it against every possible fraction. I have decided that I am going to try writing a formula to change from percent composition to the empirical formula (For anyone who doesn't know what that means ). for dimensional analysis in chemistry I wrote a unit converter). Courtesy of the Faculty of Science (Chemistry) at The University of Sydney (AU), the link below provides an easy-to-use calculator that enables you to check any. For exercises I try to write programs for lessons that I learn in class (For ex. Since the moles of O is still not a whole number, both moles can be multiplied by 2, while rounding to a whole number. Multiply each of the moles by the smallest whole number that will convert each into a whole number. I am a high school student who has gotten interested in C++ language. The chemical formula for water is H2O, which means this molecule has 3 atoms: 2 of hydrogen (H) and 1 oxygen (O) atom. The 'non-whole number' empirical formula of the compound is Fe 1 O 1.5.
