South Africa Class 1 - Jarrod Benjamin - JS-Core 1 - Week 1#36
South Africa Class 1 - Jarrod Benjamin - JS-Core 1 - Week 1#36JarrodBen wants to merge 5 commits into
Conversation
Did up until "I" and am now busy with "J", I will do the rest till "L" tomorrow.
Did the last of the exercises that I had not finished in the 1st commit
Finished off all the 4 exercises in the mandatory folder
Just fixed my answer to this exercise.
|
Hi Ben, your code is very clean and readable. Looking at exercises/L-functions-nested/exercise2.js you can also have one function which converts the name to upper case and prints the greeting message. I like the way you commit it makes it easy to follow along your code. Keep up the good work. |
|
Hey Andile, I will consider doing that with that exercise, thanks for the feedback, appreciate it. 👍 |
| @@ -1 +1,10 @@ | |||
| // Start by creating a variables `numberOfStudents` and `numberOfMentors` | |||
| var numberOfStudents = "Number of students: 15" | |||
There was a problem hiding this comment.
I think code should have been like, <<"Number of students: " + numberOfStudents
There was a problem hiding this comment.
Done, thanks for the feedback.
| var numberOfStudents = 15; | ||
| var numberOfMentors = 8; | ||
|
|
||
| var quotientStudents = 15/23 * 100 |
There was a problem hiding this comment.
You should not hard code the values of the variables, use the variable names instead. e.g. quotientStudents = numberOfStudents / (numberOfStudents + numberOfMentors) * 100
There was a problem hiding this comment.
Done, thanks for the feedback.
| } | ||
|
|
||
| // Add comments to explain what this function does. You're meant to use Google! | ||
| // This function is going to concatenate the string arguments to the calling string and then returns the new string |
There was a problem hiding this comment.
You lost me. What is a calling string?
There was a problem hiding this comment.
The calling string is what comes before the .concat so in this case it would be w1
There was a problem hiding this comment.
Done, thanks for the feedback.
| @@ -1,16 +1,21 @@ | |||
| // Add comments to explain what this function does. You're meant to use Google! | |||
| // Add comments to explain what this function does. You're meant to use Google! | |||
| /* Math.random returns a pseudo-random number between 0 - less than 1 (by default) | |||
There was a problem hiding this comment.
This definition is kinda generic. You should have tailored it to what the underlying method do
There was a problem hiding this comment.
Will look up for a new more defining definition.
There was a problem hiding this comment.
Done, thanks for the feedback.
|
|
||
| function calculateSalesTax() {} | ||
| function calculateSalesTax(price) { | ||
| const taxChargeAmount = price + (20 / 100) * price |
There was a problem hiding this comment.
Sometimes you have to avoid declaring too much variables in order to shorten your code. Try putting the "method operation" statement on the return statement if its short enough
There was a problem hiding this comment.
Done, thanks for the feedback.
Fixed and shortened some code and fixed some comments.
|
Your coursework submission has been closed because nobody has interacted with it in 30 days. You are welcome to re-open it to get more feedback. |
Your Details
Homework Details