Skip to content

Instantly share code, notes, and snippets.

@joeyv
Last active December 24, 2015 14:29
Show Gist options
  • Save joeyv/6813193 to your computer and use it in GitHub Desktop.
Save joeyv/6813193 to your computer and use it in GitHub Desktop.
A simple program to calculate your ideal weight based off of your height.
import java.util.Scanner;
public class Weight
{
static Scanner sc = new Scanner(System.in);
public static void main(String []args)
{
double feet = 0.0, inch = 0.0, height = 0.0, girl = 0.0, man = 0.0;
double gper = 0.0, mper = 0.0;
feet = sc.nextDouble();
inch = sc.nextDouble();
height = ((feet * 12) + inch) - 60;
//System.out.print (height);
//Chick weight
girl = (100 + (height * 5));
gper = girl * 0.15;
System.out.println ("\nIdeal chick weight: " + (girl-gper) + " - " + (girl+gper) + "lbs");
//Man weight
man = (106 + (6 * height));
mper = man * 0.15;
System.out.println ("Ideal Man weight: " + (man-mper) + " - " + (man+mper) + "lbs");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment