We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2d96c9d + bd655c9 commit 9a5dbcaCopy full SHA for 9a5dbca
2-variables/dog-years/HumanYears.swift
@@ -0,0 +1,17 @@
1
+//Human Years
2
+//Jacob Kline
3
+//Much like the Dog Years program, this program only works when the human age is above the "underageYears" (21 years)
4
+
5
+//This is the human's age stored as a double
6
+var humanAge: Double = 21.5
7
8
+//This is how many dog years a human's "underage years" (first 21 years) are
9
+let underageYears: Double = 2
10
11
+//This is how many dog years a human's "later years" make up (every year of their life except their first 21)
12
+let adultYears: Double = (humanAge - 21) / 4
13
14
+//This is the total age of the human in dog years
15
+let dogYears: Double = underageYears + adultYears
16
17
+print("My Name is Jacob! Hi hi, I am \(dogYears) years old in dog years.")
0 commit comments