Now you'll be making many many variables. You will be so very able! (Sorry about that.)
Welcome to your first test-based assignment! You're gonna love it once you get the hang of it.
You'll:
- Create and clone a new repo.
- Copy project contents into your new local 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!
- 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
xis5and you're asked to setyin terms ofxso that it's twicex, 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.
- Create a variable called
myFirstName. AssignmyFirstNamea string value that represents your first name. - Create a variable called
myLastName. AssignmyLastNamea string value that represents your last name. - Create a variable called
myBestFriend. AssignmyBestFrienda string value that represents your best friend name. - Create a variable called
mySentence. AssignmySentencea string that includes the variables from the previous three tasks. - Create another variable called
myFavoriteNum. AssignmyFavoriteNuma number value that represents your favorite number! - Create another variable called
myMentalAge. AssignmyMentalAgea number value that represents your mental age! - Create another variable called
myHeight. AssignmyHeighta number value that represents your height in inches or centimeters! - Create another variable called
myFavoriteYear. AssignmyFavoriteYeara number value that represents your favorite year!
- 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
myHeightAndAge. Set it equal to the sum of your mental age and height. Calculate it in code!