Sichmeller's+Java+Code



Chapter 6

/** PersonYearstoDogYearsConverter. java converts a person's years to dog years


 * @author Vince Sichmeller


 * @version for Alice+Java book.

import java.util.Scanner;

public class Ch7project { /**


 * @param args



public static void main(String[] args) {

//TODO Auto-generated method stub//

//System.out.print("How old are you? ");//questions user

Scanner kbd = new Scanner (System.in); //Java 1.5 or later//

//double personsyears = kbd.nextDouble;//input from the user

System.out.print ("How fast does a dog age in a year?");//questions user again//

//double yearsPeryear = kbd.nextDouble;// input from user

double dogyears = personsyears * yearsPeryear; //multiply the person's age by 7//

//System.out.println (personsyears + "personsyears => " + dogyears + " dogyears");// answer to problem

// TODO Auto-generated method stub }