Borek & Suraj have given the chemistry for you and there's not much I could say on the theory. But this is an interesting question:
Drakkith said:
My question is how was I supposed to know the products of this reaction? I can't find any rules regarding this in the chapters we've covered in my book. What are the rules regarding CO3 and NH4 when it comes to heating them?
For reference, we've just learned about redox, precipitation, decomposition, synthesis, and single/double replacement reactions. My textbook is: Chemistry: The Central Science, 13th Edition, by Brown, LeMay, Bursten, Murphy, Woodward, and Stoltzfus.
I suspect there aren't simple rules (though I'm sure, when one learns all the details of atomic structure and bonding, rules could be made), that what is needed here is experience. You have a vast knowledge of what compounds exist and their properties even before you learn any rules about them. I expect, if you are studying chemistry, you will have done lots of simple "experiments", heating metal salts to decompose them, detecting carbon dioxide by blowing through limewater, dissolving metals, oxides and carbonates in acid, mixing solutions to produce precipitates, etc. And you've probably been writing down chemical equations for them, so that you are familiar with the common entities, the metals, oxides, halides, common compound anions and ammonia. (You have my sympathy with ammonia. It's always struck me as an oddity, but its pungence does make it very memorable.)
So when you come to a question like this, you are looking at these experiences and trying to find something that fits. I'm not a chemist (beyond school 47 years ago) and afaik I've never seen this reaction (though I've come across "smelling salts", which I think are ammonium carbonate), but I guessed it would decompose, that I'd end up with carbon dioxide (what you always got in carbonate experiments) and ammonia (given a bit of encouragement ammonium salts always seem to produce ammonia and turn the damp litmus blue .) Then it's just a matter of making the equation balance - which turns out to be water, as in many other reactions. Maybe the condensation was a clue to water (I didn't notice that!) and you start with CO
2 and water, then find the ammonia (or nitrogen and hydrogen) left over.
And I may well be wrong! Maybe the ammonia decomposes (at least a bit) to give nitrogen and hydrogen. I'd bet if you got it hot enough it would (based on the Haber process.)
Your attempted solution was near, but you did not recognise the products, nor that the formulae you wrote down were compounds that you'd never seen before. That I think is where you should have taken a second look and said, what compounds DO I know that are near what I've written.
Perhaps you are still a bit shaky on chemical formulae and need to practice this. I would say though, don't carry on happily writing down formulae as if it were just a maths exercise. Look at what you have written and ask yourself, "what is it?"
I can't tell if you are just struggling through a compulsory chemistry course, or are really keen to understand it. If the latter and your course is like so many now, almost devoid of practical work, you might consider doing some simple experimentation at home. I think there is nothing as good as doing experiments to make them stay in your mind. I can still remember some of the simple science experiments I did at school more than 50 years ago. (You won't be able to do some that require complicated apparatus or dangerous substances, but there are plenty of things you can do safely with very little equipment.)