public class Interest {

     /*
        This class implements a simple program that
        will compute the amount of interest that is
        earned on $17,000 invested at an interest
        rate of 0.07 for one year.  The interest and
        the value of the investment after one year are
        printed to standard output.
     */
  
     public static void main(String[] args) {
     
         double principal = 17000;  // the value of the investment
         double rate = 0.07;        // the annual interest rate
         double interest;           // interest earned in one year
         
         interest = principal * rate;   // compute the interest
         
         principal = principal + interest;
               // compute value of investment after one year, with interest
               // (Note: The new value replaces the old value of principal.)
               
         System.out.print("The interest earned is $");
         System.out.println(interest);
         System.out.print("The value of the investment after one year is $");
         System.out.println(principal);
                        
     } // end of main()
        
 } // end of class Interest
