Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

hw #6

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 34 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ c = a;
### Your solution here:
1. What is `a`?
```
a is ...
a is 1
```
2. What is `b`?
```
b is ...
b is bongos
```
3. What is `c`?
```
c is ...
c is true
```

## Activity Concatenation
Expand All @@ -54,7 +54,8 @@ Result should be:
### Your solution here:
4. Fill in the `console.log()`?
```js
console.log()

console.log(firstWord + " " + secondWord + " " + thirdWord + " " + fouthWord)
```

Output a console log `The sum of 5 and 10 is 15` where the values for 5 and 10 are saved to variables, and where 15 comes from those variables being summed.
Expand All @@ -67,38 +68,40 @@ const num2 = 10;
5. How can we make `num3` equal to the sum of `num1` and `num2`?
```js
// your solution here
num3=num1+num2

```
6. Use variables `num1`, `num2` and `num3` to fill in the `console.log()` to complete the sentence:
6. Use variables `num1`, `num2` and `num3` to fill in the `console.log()` to complete the sentence:

>The sum of 5 and 10 is 15

```js
console.log()
console.log(num3=num1 + num2)
```

## Activity Comparisons
By just looking at the following expressions, determine in your mind whether or not each will evaluate to true or false
```
a) 999 > 999
b) 999 === 999
b) 999 === 999
c) 999 !== 999
d) -5 >= -4
e) 100 <= -100
f) 20 + 5 < 5
f) 20 + 5 < 5
g) 81 / 9 === 9
h) 9 !== 8 + 1
```
### Your solution here:
7. Write `true` or `false` based on the list above
```
a)
b)
c)
d)
e)
f)
g)
h)
a)false
b) true
c)false
d)false
e)false
f)false
g)true
h)false
```

## Activity Conditionals
Expand All @@ -114,6 +117,20 @@ Write a conditional statement that...
8. Write your javascript solution below
```js
// your answer here
function printFizz(number) {
if (number % 3){
console.log('Fizz');
}
if (number % 5) {
console.log('Buzz');
}
if (number % 3 and % 5) {
console.log('FizzBuss');
}
else {
console.log(number);
}
}
```

#### BONUS
Expand All @@ -133,4 +150,4 @@ For more practice read about...
- https://javascript.info/operators
- https://javascript.info/comparison
- https://javascript.info/ifelse
- https://javascript.info/logical-operators
- https://javascript.info/logical-operators