Why and when do you add +coupon payment for a binomial tree ending period calculation?

I saw an example that didn’t add the coupon during the final year. But some calculated like 0.5*(104/1.0450+104/1.0450) + 4 Why and when do you add the +4 again at the end?

Because you get that cash flow at that time. The only period you do not add a cash flow is the initial period

just picture a bond. if you pay $103 for a coupon bond today, you won’t receive a coupon today.