CS 201 - Computer Science I - Spring 2004
Project 1


Loyola College > Department of Computer Science > CS 201 > Projects > Project 1

Due

Thursday, February 26th at 11:59pm. Projects will be penalized 20% for each day after the due date. Projects will not be accepted more than four days late.

Objectives

Introduction

A level-coupon bond is an investment that provides the investor with repeating yearly payments over a fixed period of time. These yearly payments are called coupons. At the end of this period of time, the bondholder receives a lump sum; this amount is referred to as the face value of the bond.

The formula for calculating the value of a bond is

annuity formula

where r is the discount rate expressed as a decimal (so 0.01 for 1%), T is the number of payments that you will recieve, C is the amount of the coupon payment, and F is the face value of the bond.

Assignment

Write a program called BondCalculator that allows the user to enter the face value of the bond and discount rate and displays the value of the bond assuming yearly coupon payments over 20 years of 5% of the face value of the bond.

The user's input will look like $100000 @ 4 1/4%. For full credit, make only the following assumptions about the input:

The output should appear in a dialog box with a message like

The value is 109970.77435615206
(but check with a calculator to see what the correct number is for the input given above).

For full credit, you must use a helper class called Bond that holds the face value, coupon amount (assumed to be 5% of the face value for this assignment), discount rate, and term of the bond (assumed to be 20 years for the purposes of this assignment). Your Bond class should have

Grading

Submissions

Submit the source code for your Bond and BondCalculator classes.