-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDogLab
30 lines (27 loc) · 795 Bytes
/
DogLab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package DogLab;
import java.util.Scanner;
/**
*
* @author 18shahk
*/
public class dogLab {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
double dog, human;
Scanner s = new Scanner(System.in);
System.out.println("how many years old is your dog?");
dog = s.nextDouble();
human = getHuman(dog);
System.out.println("In human years, your dog is approximately " + Math.round(human) + "years old");
}
public static double getHuman(double dog){+
human = 13 + 5.33*(dog - 1);
}
}