Manchester-NW5-Esam-Ahmed- Javascript-week2 - #409
Conversation
| var greeting = "Hello world"; | ||
| console.log(greeting); | ||
| console.log(greeting); | ||
| console.log(greeting); |
| console.log(message); | ||
| var names = " Esam "; | ||
| var nameLength = names.trim(); | ||
| console.log(nameLength); |
There was a problem hiding this comment.
Good use of .trim. You also need to use .length to get the number of letters in the name.
| // const nameLength = names.length; | ||
|
|
||
| console.log(message); | ||
| console.log(nameLength); |
There was a problem hiding this comment.
As with the previous exercise, you need to use .length to get the number of letters in the name
| var numberOfStudents = 45; | ||
| var numberOfMentors = 10; | ||
| var TotalOfAll = numberOfMentors + numberOfStudents; | ||
| console.log(TotalOfAll); |
There was a problem hiding this comment.
Your code is correctly adding 2 numbers and outputting the result. If you read the question and expected output, you will see that you should be using different numbers and outputting more details. Also, variable names in Javascript are normally in lower camel case, i.e. totalOfAll
| var studentPercent = "Percentage Students:" + Math.round((numberOfStudents / total) * 100 ) + "%"; | ||
| var mentorPercent = "Percentage Mentors:" + Math.round((numberOfMentors / total) * 100) + "%"; | ||
| console.log(studentPercent); | ||
| console.log(mentorPercent); |
| @@ -1,5 +1,7 @@ | |||
| // Declare your function here | |||
|
|
|||
| function createLongGreeting (name, age){ | |||
There was a problem hiding this comment.
Good use of meaningful variable names
| var mentorName = uppercaseName(mentor); | ||
| var message = "Hello " + mentorName; | ||
| console.log(message); | ||
| } |
There was a problem hiding this comment.
You have clearly understood how to call one function from another, and again, you have used goo variable names.
KarenPudner
left a comment
There was a problem hiding this comment.
Your code works well and you have clearly understood all the concepts covered. You need to ensure that you read the questions and expected output for each exercise - there are a couple of exercises where your code works but you have not answered the exact question asked. But otherwise this is very good.
|
Good work Esam, Your code is very clear, just a suggestion rename your pull request to Manchester-NW5-Esam-Ahmed- Javascript-week1 instead of Manchester-NW5-Esam-Ahmed- Javascript-week2 |
Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in
HOW_TO_MARK.mdin the root of this repositoryYour Details
Homework Details
Notes
What did you find easy?
What did you find hard?
What do you still not understand?
Any other notes?