CODE BULLSHIT - text
Embed
You can embed this paste into a blog or website with this code:
<iframe class="codetidy" type="text/html" width="100%" src="http://codetidy.com/paste/embed/1850" frameborder="0"></iframe>
import java.io.*;

import java.util.Scanner;

import java.io.IOException;

import java.lang.*;

public class main

{

static void main(String[] args)

{

Scanner charInput = new Scanner(System.in);

Scanner fl_in = new Scanner(System.in);

String whichMethod;

char finalSel;

int aMethod = 0;

int mMethod = 0;

System.out.println("Which method would you like to use? (A)merican or (M)etric");

whichMethod = charInput.next();

System.out.println(whichMethod.length());

if(whichMethod == "A" || whichMethod == "a")

{

aMethod = 1;

mMethod = 0;

}

else if(whichMethod == "M" || whichMethod == "m")

{

aMethod = 0;

mMethod = 1;

}

// Variables for Calculations

double weight;

double height;

double BMI;

// Start of input

System.out.println(aMethod);

System.out.println(mMethod);

if (aMethod < mMethod) {

// American Method

System.out.println("Please enter your weight in pounds: ");

weight = fl_in.nextFloat();

System.out.println("Please enter your height in inches: ");

height = fl_in.nextFloat();

}else{

System.out.println("Please enter your weight in kilograms: ");

weight = charInput.nextFloat();

height = charInput.nextFloat();

}

if (aMethod < mMethod) {

// American Method

BMI = (weight * 703) / Math.pow(height,2);

}else{

BMI = weight / Math.pow(height,2);

}

if(BMI > 25)

{

System.out.println("Your fat");

}else if (BMI < 18.5)

{

System.out.println("Too Skinny");

}else{

System.out.println("Very Nice");

}

System.out.println("YOUR BMI IS "+BMI+"!");

}

}
