Make Variables Not War

Now you'll be making many many variables. You will be so very able! (Sorry about that.)

Setup

Welcome to your first test-based assignment! You're gonna love it once you get the hang of it.

You'll:

  • Fork and clone this repo.
  • Navigate into the directory.
  • Run jest --watch-all.
  • Write your code in the section below "YOUR CODE BELOW" in main.js.
  • Watch as your tests turn green.
  • Add a link to your repo as your assignment submission when you're done!

Guidelines

  • If another variable is mentioned in a task's description, that variable needs to appear in your code for that task to be marked correct. In other words, if x is 5 and you're asked to set y in terms of x so that it's twice x, the following code is correct:
y = x * 2;

While the following code is not:

y = 10;

This is because in the first example, if x changed value, y would continue to be twice x, but in the second example, y would always be 10.

Tasks

  • Create a variable called myFirstName. Assign myFirstName a string value that represents your first name.
  • Create a variable called myLastName. Assign myLastName a string value that represents your last name.
  • Create a variable called myBestFriend. Assign myBestFriend a string value that represents your best friend name.
  • Create a variable called mySentence. Assign mySentence a string that includes the variables from the previous three tasks.
  • Create another variable called myFavoriteNum. Assign myFavoriteNum a number value that represents your favorite number!
  • Create another variable called myMentalAge. Assign myMentalAge a number value that represents your mental age!
  • Create another variable called myHeight. Assign myHeight a number value that represents your height in inches or centimeters!
  • Create another variable called myFavoriteYear. Assign myFavoriteYear a number value that represents your favorite year!

Tasks that use MATH

  • Create another variable called mySum. Set it equal to the result of three plus one thousand nine hundred eighteen plus twenty-four plus one. Calculate it in code!
  • Create another variable called myProduct. Set it equal to the result of two hundred thirty-two times forty-three divided by two plus four (the operations should be written in that order!). Calculate it in code!
  • Create another variable called heightAndAge. Set it equal to the sum of your mental age and height. Calculate it in code!