* To learn about named constants, floating point arithmetic, console input using the Scanner class,
* and formatting output with the printf method.
/**
* To learn about named constants, floating point arithmetic, console input using the Scanner class,
* and formatting output with the printf method.
*
* @author (MrK)
* @version (v1.0)
*/
import java.util.Scanner;
public class Part1
{
public static void main(String [] args)
{
double wre = 1.0, wrm = 0.38, pre = 1.0, prm = 1.88, we, ae, wm, am;
Scanner keyIn = new Scanner(System.in);
System.out.println("\t Programmer : MrK");
System.out.println("\t Course : COSC 111, Winter 2009" );
System.out.println("\t Lab# : 4");
System.out.println("\t Due date : 2-3-09 \n");
System.out.print("\t Enter your weight in pounds :");
we = keyIn.nextDouble();
System.out.print("\t Enter your age in years ");
ae = keyIn.nextDouble();
System.out.print("\n");
wm = we * wrm;
am = ae / prm;
System.out.printf("\t On Earth you weigh %.1f and are %.1f years old \n", we, ae);
System.out.printf("\t On Mars you weigh %.1f and are %.1f years old \n", wm, am);
}
}