Bonds are loans given by investors to borrowers such as governments and businesses. The investor earns…