LONDON CLASS_8 - RAHWA GHEBREMICHAEL - MODULE - JS1 WEEK_1 - #252
LONDON CLASS_8 - RAHWA GHEBREMICHAEL - MODULE - JS1 WEEK_1#252rahwafesseha wants to merge 4 commits into
Conversation
AmarachiOkereke
left a comment
There was a problem hiding this comment.
Well done Rahwa for a great job. The only thing I can see is that you have used 'var' 'let' and 'const' respectively in different places. I think 'var' keyword is getting outdated now. The 'let' and 'const' seems to be the right keyword to use. Maybe you can research on this. Nice job.
Dear Amarachi, Thank you for reviewing my work. |
mahsa2
left a comment
There was a problem hiding this comment.
Well done Rahwa on completing your assignment here 💯
It's pretty important, yet simple, to indent our codes correctly. Please read this guide for how to indent codes: https://codehs.gitbooks.io/introcs/content/Programming-with-Karel/how-to-indent-your-code.html
| console.log(typeof message); | ||
|
|
||
| //Terminal shows undefined | ||
| console.log(typeof text); |
There was a problem hiding this comment.
You also need to output the variables too not just their type. In the example, they missed it too.
| //Write a program that logs a message and its type | ||
| const number = 4; | ||
| let message = "Rahwa"; | ||
| let text; |
There was a problem hiding this comment.
We use const if the content of the variable will not change, and if it changes we use let. So in this case all of them should have been const.
| var numberOfStudents = 15; | ||
| var numberOfMentors = 8; | ||
| var total = numberOfStudents + numberOfMentors; | ||
| var percentageOfStudents = (Math.round(numberOfStudents/total * 100)); |
There was a problem hiding this comment.
The outer () aren't needed.
It's best to leave spaces between mathematica ops.
Math.round(numberOfStudents / total * 100)
|
|
||
| var greeting = createGreeting("Daniel"); | ||
| function creatGreeting(nameOfPerson){ | ||
| return `Hello, my name is ${nameOfPerson}`; |
There was a problem hiding this comment.
Indentations and spacing should be like this:
function creatGreeting(nameOfPerson) {
return `Hello, my name is ${nameOfPerson}`;
}
| function upperCase(greeting, nameOfPerson){ | ||
|
|
||
| let text = `${greeting.toUpperCase()} ${nameOfPerson.toUpperCase()}`; | ||
| return text; |
There was a problem hiding this comment.
All the content of the function need to be indented forward.
| function addNumbers(a, b, c) { | ||
| return a + b + c; | ||
| } | ||
| console.log(addNumbers(3, 4, 6)); |
There was a problem hiding this comment.
In the test, we don't want to leave any debugging content.
All the console.logs are for debuggying purposes only. You should remove them from test files.
The tests will call the functions at the end of the file and check the results.
| return firstWord.concat( " ", secondWord, " ", thirdWord); | ||
| } | ||
|
|
||
| console.log(concatenate("code", "your", "future")); |
| } | ||
| console.log(addTaxAndFormatCurrency(15)); | ||
| console.log(addTaxAndFormatCurrency(17.5)); | ||
| console.log(addTaxAndFormatCurrency(34)); |
|
|
||
| console.log(calculateSalesTax(15)); | ||
| console.log(calculateSalesTax(17.50)); | ||
| console.log(calculateSalesTax(34)); |
| "license": "CC-BY-SA-4.0", | ||
| "scripts": { | ||
| "test": "jest" | ||
| "test": "jest","extra-tests":"jest extra" |
There was a problem hiding this comment.
You don't need to change this file.
If you run npm test it runs all the tests for you anyways.
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?
using the built in terminal in VS code.
What did you find hard?
calling and declaring a function are a bit confusing.
What do you still not understand?
Everything is clear so far.
Any other notes?