4) cin of an int is weird. its going to read the whole thing and consume it all. However if it had started with a valid int and had more junk, eg 123xxx:fubar! it would give you 123 as the int and leave the rest of the buffer intact. It will usually give zero for your case (no valid int, everything consumed) but I am not sure if that is dictated or compiler chosen.
7) is important. getline and cin are at odds, look up online about using both together. The long and short of it is that cin requires you to type enter, which puts a new line in the buffer as well. You need to track IB by that new line here. cin would leave the new line, getline consumes it, so IB is actually for all the cin answers when you think it read all the stuff, it will actually be sitting on the new line (which next cin will ignore as whitespace). getline will read the newline, the buffer is *empty*.