diff --git a/beyoncesAccountant.js b/beyoncesAccountant.js index 4029517..d5bdf5b 100644 --- a/beyoncesAccountant.js +++ b/beyoncesAccountant.js @@ -1,13 +1,7 @@ +var totalSum = 500 + 750 + 3000 + 5100 + 12980 + 9087 + 50000; + console.log("Dear Beyonce,") console.log("We have calculated your total earnings this year.") -console.log("You have earned " + beyoncesMoney) -console.log("Of" + 500 + 750 + 3000 + 5100 + 12980 + 9087 + 50000 + " some portion derives from your live performances.") -console.log("Of" + 500 + 750 + 3000 + 5100 + 12980 + 9087 + 50000 + " some portion derives from music sales.") - - -// DON'T DO THIS PART YET: -// Now that we understand what a variable is -// rewrite the above lines of code using a variable to store the -// total sum, so that you don't have to add up all those numbers three times - - +console.log("You have earned " + totalSum) +console.log("Of" + totalSum + " some portion derives from your live performances.") +console.log("Of" + totalSum + " some portion derives from music sales.") \ No newline at end of file diff --git a/functions.js b/functions.js index 6bb78ca..0d5ff5b 100644 --- a/functions.js +++ b/functions.js @@ -10,7 +10,7 @@ function NameofFunction() { } function addNumbers(num1, num2, num3, num4) { - num1 + num2 + num3 + num4 + return num1 + num2 + num3 + num4 }