Posts

Showing posts from March 18, 2012

Conversion Of Big Number into Words(In Indian System).

package snlkjha; import java.util.*; import java.math.BigInteger; /**  * @author snlkjha  */ public class N2word {     public static String get(int n){         String[] x1={"","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thrteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Ninteen"};         String[] x2={"","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninty","Hundred"};         if(n<20) return x1[n];         else return x2[n/10]+" "+x1[n%10];     }       public static String convert_number_into_words(BigInteger n){       String message=" Only",x3[]={"",...

Program for finding Body Mass Index Using JAVA

/*  * BODY MASS INDEX  * It is a numeric indicator of human body fat based on a person weight and height.It is applicable to adult men  * and women and is mainy used to screen indivduals in order to detect potential weight problems.  * The common formulafor calculating BMI = Mass(Kg)/[height(m)]^2  * It was invented by Begian Scinetist Adolphe Quetelet and hence it is also known as the Quetelet Index.  * A BMI of 18.5 to 24.9 is considered normal.  */ package Snlkjha; import javax.swing.*; /**  * @author Snlkjha  */ public class BodyMassIndex {     public static void main(String[] args) {                 String wt = JOptionPane.showInputDialog("Enter Weight(In Kg):");         String ht = JOptionPane.showInputDialog("Enter Height(In Inch):");         double weight = Double.valueOf(wt).doubleValue();         double...