Moving on in the chapter we are looking at a similar example.
Consider a three year 6% bond purchased @ par by an investor with a one year investment horizon. If ytm increases from 6% to 7% after purchase and the bond is sold after one year, the rate of return can be calculated as follows:
Bond price just after 1st coupon has been paid with YTM = 7%
The bond price a the selling time is the PV of the remaining cash flows , i.e. only the remaining years until maturity are relevant. If the total lifetime is 3 years and you sell the bond after one year the buyer will still receive coupons for two years (N=2) plus the principal at maturity which is on what the selling price is based on. Draw a timeline and it should become clear.