Skip to content

Commit

Permalink
Added multiple questions (#3146)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Livingston committed Feb 18, 2022
1 parent d2fe59d commit a5a71cf
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
22 changes: 22 additions & 0 deletions git/git-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -835,3 +835,25 @@ Which of the following options is correct ?
- [ ] Execute `git checkout -b <branchname>`.
[Reference](https://stackoverflow.com/questions/1992364/git-recover-deleted-remote-branch)
#### Q102. After checking your Git status, you get the following output, which shows the file beta-notes.js in the commit but also unstaged. How can this situation occur?
```bash
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: beta-notes.js
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: beta-notes.js
```
- [ ] There were two copies of beta-notes.js but one was deleted.
- [ ] There are two tracked copies of beta-notes.js but one was removed from the commit.
- [ ] Two copies of beta-notes.js were created, but only one is being tracked.
- [x] beta-notes.js was staged, then modified afterwards, creating two different versions of the file.
[Reference](https://stackoverflow.com/questions/24837841/can-a-file-be-both-staged-and-unstaged-in-git)
44 changes: 44 additions & 0 deletions json/json-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -902,3 +902,47 @@ variance: -0.0823
- [ ] "variance": "\-0.0823"

[Reference data types in json](https://www.w3schools.com/js/js_json_datatypes.asp)

### Q87. Based on the JSON object shown, which JavaScript code would you use to find out what is in this vehicle's glove box while assigning the glove box contents to a new variable?

```js
myVehicleContents = {
"van": {
"inside": {
"glove box": "maps",
"passenger seat": "crumbs"
},
"exterior": {
"trunk": "jack"
}
}
}
```

- [ ] A

```js
myVehicleContents.van.inside["glove box"] = gloveBoxContents;
```

- [x] B

```js
var gloveBoxContents = myVehicleContents.van.inside["glove box"];
gloveBoxContents;
```

- [ ] C

```js
var gloveBoxContents = myVehicleContents.van.glove box.contents;
gloveBoxContents;
```

- [ ] D

```js
myVehicleContents.van.inside["inside"] = gloveBoxContents;
```

[Source](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)
9 changes: 9 additions & 0 deletions php/php-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -976,3 +976,12 @@ Dog
`while ($i < 10) {`
` echo ++$i . '<br/>';`
`}`

#### Q82. Which are types of control structures in PHP?

- [x] `break`, `continue`, `do-while`, `exception`, `for`, `foreach`, `if`, `switch`, `throw`, `while`
- [ ] `values`, `operators`, `expressions`, `keywords`, `comments`
- [ ] `for`, `foreach`, `if`, `else`, `else if`, `switch`, `tries`, `throws`, `while`
- [ ] `if-then-else`, `do-while`, `for-each`, `go-to`, `stop-when`

[reference](https://www.php.net/manual/en/language.control-structures.php)

0 comments on commit a5a71cf

Please sign in to comment.