Answer:
When shares are repurchased, they are recorded at the cost price in the books which means that they will be recorded at:
= 100 * 40
= $4,000
Cash will then be credited because assets are credited when they reduce.
Treasury stock will be debited to show that Equity is reducing.
Date            Account Title                 Debit          Credit
June, 30         Treasury Stock               $4,000
                Cash                                    $4,000