Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

LONDON CLASS_8 - RAHWA GHEBREMICHAEL - MODULE - JS1 WEEK_1 - #252

Closed
rahwafesseha wants to merge 4 commits into
CodeYourFuture:masterfrom
rahwafesseha:master
Closed

LONDON CLASS_8 - RAHWA GHEBREMICHAEL - MODULE - JS1 WEEK_1#252
rahwafesseha wants to merge 4 commits into
CodeYourFuture:masterfrom
rahwafesseha:master

Conversation

@rahwafesseha

Copy link
Copy Markdown

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name: Rahwa
  • Your City: London
  • Your Slack Name: Rahwa

Homework Details

  • Module:JS-1
  • Week: Week-1

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?

@AmarachiOkereke AmarachiOkereke left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rahwafesseha

Copy link
Copy Markdown
Author

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.
I was already aware of that and I thought I changed all the var to let. Thanks for pointing that out.

@mahsa2 mahsa2 added the LDN8 label Dec 20, 2021

@mahsa2 mahsa2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, no console.log should be here.

Comment thread mandatory/4-tax.js
}
console.log(addTaxAndFormatCurrency(15));
console.log(addTaxAndFormatCurrency(17.5));
console.log(addTaxAndFormatCurrency(34));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, no console.log should be here.

Comment thread mandatory/4-tax.js

console.log(calculateSalesTax(15));
console.log(calculateSalesTax(17.50));
console.log(calculateSalesTax(34));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, no console.log should be here.

Comment thread package.json
"license": "CC-BY-SA-4.0",
"scripts": {
"test": "jest"
"test": "jest","extra-tests":"jest extra"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to change this file.
If you run npm test it runs all the tests for you anyways.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants