JavaScript-Core-1-Coursework-Week1- north-west-class4-abed - #132
JavaScript-Core-1-Coursework-Week1- north-west-class4-abed#132Abed-Aghbar wants to merge 1 commit into
Conversation
| return "Hello " + name; | ||
| } | ||
|
|
||
| function createCreeting(name1, name2, name3, name4, name5) { |
| @@ -1,3 +1,6 @@ | |||
| const name = " Daniel "; | |||
| var name = "Abed "; | |||
There was a problem hiding this comment.
Great work, nice to see you experimenting with string methods too :)
| @@ -1 +1,6 @@ | |||
| // Start by creating a variables `numberOfStudents` and `numberOfMentors` | |||
| var numberOfStudents = 15 ; | |||
There was a problem hiding this comment.
Be consistent with your semi-colons, Although they are not always required, I would suggest that you always use them until you learn more about the nuances of JavaScript's automatic semicolon insertion. Also, no need for spaces before semi-colons. Otherwise good work.
| var PercentageMentors = numberOfMentors / sum; | ||
|
|
||
|
|
||
| console.log("Percentage students: " + Math.round(PercentageStudents*100) + "%") |
There was a problem hiding this comment.
It would be better to evaluate the percentages and then pass the final values to console.log, rather that rounding the floats inside console.log, but otherwise good work.
| } | ||
| // Call the function | ||
| var greeting = nameAge("Daniel", 30); | ||
| console.log(greeting); No newline at end of file |
There was a problem hiding this comment.
Again, be mindful of consistent formatting, otherwise, great work.
| } | ||
|
|
||
| var greeting = createCreeting(mentor1, mentor2, mentor3, mentor4, mentor5); | ||
| console.log(greeting); No newline at end of file |
There was a problem hiding this comment.
Check your logging to the console. I get "Hello Yohannes" printed to the console, have a look at your return statement from the function createGreeting()
|
|
||
| function introduceMe(name, age) | ||
| return "Hello, my name is " + name "and I am " age + "years old"; | ||
| return "Hello, my name is " + name + "and I am " + age + "years old"; |
There was a problem hiding this comment.
be mindful of leading and trailing whitespace when concatenating strings, curly braces are also missing here.
| } | ||
|
|
||
| function concatenate(firstWord, secondWord, thirdWord) { | ||
| return concat(firstWord, secondWord, thirdWord) |
There was a problem hiding this comment.
concat needs to be called as a method on a string. Also be aware of any neccesary whitespace. Please request access to the solutions repo and check your answer.
|
|
||
| function addTaxAndFormatCurrency() {} | ||
| function addTaxAndFormatCurrency(new_price) { | ||
| return concat ("£" + float(new_price * 1.20)) |
There was a problem hiding this comment.
There's some issues, here. Please request access to the solutions repo and check your answer. If there is something you don't understand, please let me know.
|
Your coursework submission has been closed because nobody has interacted with it in six weeks. You are welcome to re-open it to get more feedback. |
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?