From b2ba337533b98299e2497f0c9294dbd16a3eebaa Mon Sep 17 00:00:00 2001 From: Ajin Sunny Date: Sat, 25 Jul 2020 14:51:03 -0700 Subject: [PATCH] Update MathMagic.kt type: Updated some comments to the code. All process of magicNum addition is clearly commented out. --- 2-data-types-variables/Math-Magic/MathMagic.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/2-data-types-variables/Math-Magic/MathMagic.kt b/2-data-types-variables/Math-Magic/MathMagic.kt index dd7a270..264a752 100644 --- a/2-data-types-variables/Math-Magic/MathMagic.kt +++ b/2-data-types-variables/Math-Magic/MathMagic.kt @@ -5,15 +5,21 @@ fun main() { val userName = "Galina" var magicNum: Int + // Multiply first digit of your age by 5 and assign it to magicNum magicNum = 2 * 5 - + + // Add 3 to the magicNum variable magicNum += 3 + // Multiply 2 to the magicNum variable magicNum *= 2 + // Add 5 to the magicNum variable magicNum += 5 + // Subtract 6 to the magicNum Variable magicNum -= 6 + // Print the desired output using String templates println("$userName's age is $magicNum") -} \ No newline at end of file +}