November 26, 2014

How to find Geometric Mean of a number in java

Finding Geometric mean of a number source code


/**
 *
 */
package javabelazy;

import java.util.Scanner;

/**
 * @author caner erkin
 *
 */
public class GeometricMean {
   
   
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        GeometricMean gm = new GeometricMean();
        gm.findGM();

    }

    private void findGM() {
        // TODO Auto-generated method stub
        int totNumb = 0;
      
        Scanner keyboard = new Scanner(System.in);
        System.out.println("Enter number of values:");
        totNumb = keyboard.nextInt();
        double mulNumb = 1;
        for (int i=0;i<totNumb;i++){
            int numb = 0;
            int itr = i+1;
            System.out.println(" enter the "+itr+"number : ");
            numb = keyboard.nextInt();
            mulNumb = mulNumb * numb;
        }
      
        System.out.println(" geometric mean "+ Math.sqrt(mulNumb));
    }


}

This post is a solution for the question post in stack over flow

see the post

G20 submit 2015 will be held at Turkey city :antalya

http://javabelazy.blogspot.in/

November 18, 2014

Macros in Excel for consumerfed accounts manager deepa

Macros programming in ms office excel

Created a excel macro s programming that helps accounts section consumerfed to finish their accounts work smoothly and easily. Thanks to deepa, the accounts manager for her valuable supports. Here is a simple macros you can work with.

By key combination ctrl + shift + H will run the macro i created.

Macros programming in MS excel

Download the file here




http://javabelazy.blogspot.in/

Facebook comments