Friday, August 10, 2012

Pyramid Program


Pyramid Program 1
 Output
----------
    *
   * *
  * * *
 * * * *
* * * * *

Pyramid Program 1
Source code
-------------
package com.swain.cell;

public class Piramid {

       public static void main(String args[]){
              int p=1;
              for(int i=1;i<=5;i++){
                     for(int j=i;j<5;j++){
                           System.out.print(" ");
                     }
                     for(int k=1;k<=p;k++){
                           if(k%2==0){
                                  System.out.print(" ");

                           }else
                           System.out.print("*");

                     }
                     System.out.println();
                     p+=2;
              }
       }
}

How to Calculate the Future Investment Value of Investment.

Below java program for calculate future investment value. Here calculate s using the formula futureInvestmentValue =investmentAmount x (...