diff --git a/assignment/index.html b/assignment/index.html new file mode 100644 index 0000000..926ff89 --- /dev/null +++ b/assignment/index.html @@ -0,0 +1,44 @@ + + + + Unit 2 - Part 1 + + + + + + + + + + +
+

Unit 2 Assignment - Part 1

+
+
+
+
+ In addition to passing tests, we will be looking + for
console.log()
after each question. + Right click on the page and select 'Inspect' to + open the console and view your logs. Refresh the page + to re-run tests. +
+

For example:

+
+
+let color = 'teal';
+console.log(color);
+          
+
+
+ + +

I am still having trouble gettig my code to show. I have been completing my assignments in github just trying to get it in.,
All of this is pretty new so a bit behid but slowly catching up!/p> + + +

+
+ + + diff --git a/assignment/scripts/aboutMe.js b/assignment/scripts/aboutMe.js new file mode 100644 index 0000000..766134c --- /dev/null +++ b/assignment/scripts/aboutMe.js @@ -0,0 +1,106 @@ +// REQUIRED FEATURES: +// 1 - Create a variable called `firstName` and assign it the value of your first name +let firstName = ''; +// 2 - Create a second variable called `lastName` and assign it the value of your last name + +// 3 - Create a third variable called `fullName`, assign it the value of your first and last name +// (remember, you already have variables for this, can you use those?) +// Console log the value of `fullName` + +// 4 - Create a variable called `luckyNumber` and assign it the value of your lucky number. +// Console log the value of `luckyNumber` + +// 5 - Create a variable `introduction` and using the variables from above, +// give it the value of: +// 'My name is (full name), and I think (lucky number) is a winner!'. +// Refer back to the videos if you need help with this one. +// Console log the value of `introduction` + +// 6 - Create a variable named `adventurous` and set it to a boolean value (true or false) +// Console log the value of `adventurous` + +// 7 - Create a variable named `food`, and set its value to a string of your favorite food +// Console log the value of `food` + +// 8 - Create a variable called `pets` and set it to the value of the number of pets you have +// Console log the value of `pets` + +// 9 - Create a variable called `friendsPets` and assign it the value of the number of pets your friend has + +// 10 - Add two pets to your `pets` variable + +// 11 - Create a constant variable called `allowedPets` and set it to a number value of your choice + +// 12 - Create a variable called `result`. Create a conditional: +// if adventurous is true, set `result` to be "Adventures are great!", +// if it's not true, set `result` to be "How about we stay home?" +// Console log the value of `result` + +// 13 - Create a variable called `diceRoll` and set it to the value of "Try again later.". +// Create a compound conditional: +// if luckyNumber is 2 and adventurous is true, +// set `diceRoll` to be "Roll the dice!" +// Console log the value of `diceRoll` + +// 14 - Create a variable called `petStatus`. +// Write a conditional that covers the following: +// if the value of `pets` is less than the value of `allowedPets`, +// set `petStatus` to the value of "I can have more pets" +// if the value of `pets` is equal to the value of `allowedPets`, +// set `petStatus` to the value of "I have enough pets" +// if the value of `pets` is greater than the value of `allowedPets`. +// set `petStatus` to the value of "Oh no, I have too many pets!" + + +// STRETCH GOALS: + +// 15 - Make a variable called `mostPets` and a conditional that +// correctly checks the `pets` and `friendsPets` variables, and +// assigns the highest value to `mostPets`. There's several possibilities -- +// be sure to think through all the scenarios. +// console.log `mostPets` after the conditional has run. + +// 16 - Make a variable called `luckyResult` +// Write a *switch* statement that sets `luckyResult` to: +// "First is the worst" if your lucky number is 1 +// "Second is the best" if your lucky number is 2 +// "Third is the one with the polka dot dress" if your lucky number is 3 +// Otherwise, "Luck is what happens when preparation meets opportunity" +// You'll need to research how to use switch statements! +// console.log `luckyResult` after the conditional has run. + +// 17 -- Rewrite question 12 with a `ternary` operator. You'll need to do research! + + + + + + + + + + + +// DO NOT MODIFY +// Used for automated testing +try { + module.exports = { + firstName: typeof firstName !== 'undefined' ? firstName : undefined, + lastName: typeof lastName !== 'undefined' ? lastName : undefined, + fullName: typeof fullName !== 'undefined' ? fullName : undefined, + luckyNumber: typeof luckyNumber !== 'undefined' ? luckyNumber : undefined, + introduction: typeof introduction !== 'undefined' ? introduction : undefined, + adventurous: typeof adventurous !== 'undefined' ? adventurous : undefined, + food: typeof food !== 'undefined' ? food : undefined, + pets: typeof pets !== 'undefined' ? pets : undefined, + friendsPets: typeof friendsPets !== 'undefined' ? friendsPets : undefined, + allowedPets: typeof allowedPets !== 'undefined' ? allowedPets : undefined, + result: typeof result !== 'undefined' ? result : undefined, + diceRoll: typeof diceRoll !== 'undefined' ? diceRoll : undefined, + petStatus: typeof petStatus !== 'undefined' ? petStatus : undefined, + mostPets: typeof mostPets !== 'undefined' ? mostPets : undefined, + luckyResult: typeof luckyResult !== 'undefined' ? luckyResult : undefined, + }; +} catch (e) { + // Do nothing +} \ No newline at end of file diff --git a/assignment/styles/style.css b/assignment/styles/style.css new file mode 100644 index 0000000..dd9340f --- /dev/null +++ b/assignment/styles/style.css @@ -0,0 +1,55 @@ +html, +body { + margin: 0; + padding: 0; + font-family: 'Roboto', sans-serif; +} + +header { + text-align: center; + background-color: teal; + color: white; + padding: 14px 32px; + font-weight: 500; +} + +h1 { + font-weight: 300; + font-size: 2.6em; +} + +pre { + display: inline; + margin: 0; + font-size: 1.2em; +} + +.note { + color: black; + max-width: 900px; + margin: 10px auto; + padding: 20px; + background-color: #FFFFCC; + border: 2px solid teal; + font-size: 1.2em; +} + +#container { + max-width: 1000px; + margin: 0 auto; + padding: 0 10px; +} + +#mocha-stats { + background-color: #ffffffee; + padding-top: 4px !important; + border: 1px solid darkgray; +} + +#mocha .test a.replay { + display: none; +} + +#mocha h1 a { + pointer-events: none; +} \ No newline at end of file