Kowal+(Matt)+Java+Codes


 * /** HumanToDogYearsConverter.java calculates the age a human would be in dog years


 * given the person's age.


 * @author Matt Kowal


 * @version fo Alice+Java Book



import java.util.Scanner;/*this line imports the Scanner class from the java.util package*/ public class HumanToDogYearsConverter {/*starts the method*/

public static void main(String[] args) {/*this is basicly the "my first method" from Alice*/

Scanner keyboard = new Scanner(System.in);/*initializes keyboard variable*/

System.out.print("Enter your age: ");/*asks the user for their age*/

double age = keyboard.nextDouble;/*initializes age variable*/

double dogyears = age * 7;/*calculates the years to dog years*/

System.out.printf("%nAge in dogyears: %7.0f", dogyears);/*Displays the age in dog years to no decimal places*/

} }