This repository was archived by the owner on Jan 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 475
ZA2-Tersia #296
Closed
Closed
ZA2-Tersia #296
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| console.log("Hello world"); | ||
| console.log("Hello world I am relearning Javascript :)"); | ||
| console.log(7); | ||
| console.log("this is another log"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| // Start by creating a variable `greeting` | ||
|
|
||
| var greeting = "Hello Tersia how are you today?" | ||
| console.log(greeting); | ||
| console.log(greeting); | ||
| console.log(greeting); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| // Start by creating a variable `message` | ||
| var message = "This is a string"; | ||
| var messageType = typeof message; | ||
|
|
||
| console.log(message); | ||
| console.log(messageType); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| // Start by creating a variable `message` | ||
| var greetingStart = "Hello, my name is "; | ||
| var names = "Tersia"; | ||
|
|
||
| var greeting = greetingStart + names ; | ||
|
|
||
| console.log(greeting); | ||
|
|
||
|
|
||
| console.log(message); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,17 @@ | ||
| // Start by creating a variable `message` | ||
| var greetingStart = "Hello, my name is "; | ||
| var names = "Daniel and my name is"; | ||
|
|
||
| console.log(message); | ||
| var greeting = greetingStart + names ; | ||
|
|
||
| var names = "Daniel"; | ||
| var nameLength = names.length; | ||
|
|
||
| var nameLen = " characters long" | ||
|
|
||
| var fullGreeting = greetingStart + names + nameLength + nameLen | ||
|
|
||
| console.log(greeting); | ||
| console.log(nameLength); | ||
| console.log(fullGreeting); | ||
| // My name is Daniel and my name is 6 characters long |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,17 @@ | ||
| const name = " Daniel "; | ||
| var greetingStart = "Hello, my name is "; | ||
| var names = "Tersia and my name is"; | ||
|
|
||
| var greeting = greetingStart + names ; | ||
|
|
||
| var names = "Tersia "; | ||
| var nameLength = names.length; | ||
|
|
||
| var nameLen = " characters long." | ||
|
|
||
| var fullGreeting = greetingStart + names + nameLength + nameLen | ||
|
|
||
| // console.log(greeting); | ||
| // console.log(nameLength); | ||
| console.log(fullGreeting.trim()); | ||
|
|
||
|
|
||
| console.log(message); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,12 @@ | ||
| // Start by creating a variables `numberOfStudents` and `numberOfMentors` | ||
| var studentNum = "Number of students: " | ||
| var mentorsNum = "Number of mentors: " | ||
| var people = "Total number of students and mentors:" | ||
|
|
||
| var students = 15; | ||
| var mentors = 8; | ||
| var total = 15 + 8; | ||
|
|
||
| console.log(studentNum + students); | ||
| console.log(mentorsNum + mentors); | ||
| console.log(people + total); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,15 @@ | ||
| var numberOfStudents = 15; | ||
| var numberOfMentors = 8; | ||
| var percentage = numberOfStudents + numberOfMentors; | ||
|
|
||
| let percentageOfStudents = `Percentage students: ${numberOfStudents / percentage * 100} `; | ||
| let percentageOfMentors = `Percentage mentors: ${numberOfMentors / percentage * 100}`; | ||
|
|
||
| let students = 65.21739130434783 | ||
| let studentpercent = Math.round(students) | ||
| let mentors = 34.78260869565217 | ||
| let mentorspercent = Math.round(mentors) | ||
|
|
||
|
|
||
| console.log(studentpercent); | ||
| console.log(mentorspercent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| function halve(number) { | ||
| // complete the function here | ||
| return number / 2 | ||
| } | ||
|
|
||
| var result = halve(12); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| function triple(number) { | ||
| // complete function here | ||
| return number * 3 | ||
| } | ||
|
|
||
| var result = triple(12); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,7 @@ Hello, my name is Daniel | |
|
|
||
| ## Expected result | ||
|
|
||
|
|
||
| ``` | ||
| Hello, my name is Daniel and I'm 30 years old | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| // Declare your function first | ||
|
|
||
| function divide (num1, num2){ | ||
| return num1 / num2 | ||
| } | ||
| var result = divide(3, 4); | ||
|
|
||
| console.log(result); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| // Write your function here | ||
|
|
||
| var greeting = createGreeting("Daniel"); | ||
| var greeting = "Hello my name is, Daniel" | ||
|
|
||
| function createGreeting(){ | ||
| return greeting ; | ||
| } | ||
|
|
||
|
|
||
| console.log(greeting); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| // Declare your function first | ||
|
|
||
| function addnumbers (numberone, numbertwo){ | ||
| return numberone + numbertwo | ||
| } | ||
| // Call the function and assign to a variable `sum` | ||
| var sum = addnumbers(13, 124); | ||
|
|
||
| console.log(sum); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| // Declare your function here | ||
| const string = "Hello, my name is Daniel and I'm "; | ||
| const stringtwo = " years old"; | ||
|
|
||
| const greeting = createLongGreeting("Daniel", 30); | ||
| function introduction(age){ | ||
| return string + age + stringtwo; | ||
| } | ||
| const greeting = introduction(30); | ||
|
|
||
| console.log(greeting); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,21 @@ | ||
| // Add comments to explain what this function does. You're meant to use Google! | ||
| // method to create a function that will return a random integer between 0 and 9 values | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not only returns the integer but any number between 0 and 10, that number can sometimes be 9.99 |
||
| function getRandomNumber() { | ||
| return Math.random() * 10; | ||
| } | ||
|
|
||
|
|
||
| // Add comments to explain what this function does. You're meant to use Google! | ||
| // This function concatenates two strings together | ||
| function combine2Words(word1, word2) { | ||
| return word1.concat(word2); | ||
| } | ||
|
|
||
| function concatenate(firstWord, secondWord, thirdWord) { | ||
| // Write the body of this function to concatenate three words together. | ||
| // Look at the test case below to understand what this function is expected to return. | ||
|
|
||
| return firstWord.concat("", secondWord ," ",thirdWord) | ||
| } | ||
|
|
||
| /* | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tersia, your const greeting contains two functions, one is createLongGreeting() and the other one is Introduction() so I wonder what would happen when invoking 2 functions under one variable, please review this situation.