//	Helene Martin,	Garfield	AP	CS	2010
//	Thanks to Stuart Reges and	Marty	Stepp
//	Computes	two people's BMI using parameters, returns and Scanner

import java.util.*;	//	for Scanner

public class BMI {
	 public static	void main(String[] args) {
		Scanner s =	new Scanner(System.in);
		printIntro();
		
		processPerson(1, s);
		processPerson(2, s);
	}

	public static void processPerson(int number,	Scanner s) {
		System.out.println("Enter next person's info: ");
		System.out.print("height (in inches)? ");
		double height = s.nextDouble();
		System.out.print("weight (in lbs)? ");
		double weight = s.nextDouble();
		
		double bmi	= calculateBMI(height, weight);
		System.out.println("Person " + number + " BMI = " + bmi);
		
		System.out.print("Person " + number + " is ");
		if	(bmi < 18.5) {
			System.out.println("underweight");
		} else if (bmi <= 24.9) {
			System.out.println("normal");
		} else if (bmi <= 29.9) {
			System.out.println("overweight");
		} else {
			System.out.println("obese");
		}	
	}
	
	public static double	calculateBMI(double height, double weight) {
		double bmi = weight / Math.pow(height,	2)	* 703;
		return bmi;
	}
	
	public static void printIntro() {
		System.out.println("This program reads in data for two people and");
		System.out.println("computes their body mass index (BMI)");
		System.out.println();
	}
}
