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

London10 - Khalil Alhaydr - JavaScript-core1-courswork-week1 - #493

Open
Khlil1313 wants to merge 6 commits into
CodeYourFuture:masterfrom
Khlil1313:master
Open

London10 - Khalil Alhaydr - JavaScript-core1-courswork-week1#493
Khlil1313 wants to merge 6 commits into
CodeYourFuture:masterfrom
Khlil1313:master

Conversation

@Khlil1313

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:
  • Your City:
  • Your Slack Name:

Homework Details

  • Module:
  • Week:

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?

Comment thread mandatory/2-logic-error.js Outdated

function getStringLength(word) {
return "word".length();
return word.length();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi Khalil. The length property does not need parentheses.

Comment thread mandatory/4-tax.js

function calculateSalesTax() {}
function calculateSalesTax(price) {
return price + price*0.2;

@seyyednavid seyyednavid Feb 19, 2023

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor things to suggest. Please keep spacing consistent.You did it for +, but * needs space.
I had the same problem like you for considering spaces

// There are syntax errors in this code - can you fix it to pass the tests?

function addNumbers(a b c) {
function addNumbers(a, b, c) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment: On these first three code assignments we have the same solution

a * b * c;
return;
total = a * b * c;
return total;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider: function multiply(a, b, c) {
const answer = a * b * c;
return answer;
}

// this function return a random number between 0 and 100.
function getRandomNumber() {
return Math.random() * 10;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Clear and good answer

// the concat() method join 2 strings together.
function combine2Words(word1, word2) {
return word1.concat(word2);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good answer

// Write the body of this function to concatenate three words together.
// Look at the test case below to understand what this function is expected to return.
return firstWord.concat(" ", secondWord, " ", thirdWord);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same as me

Comment thread mandatory/4-tax.js

function calculateSalesTax() {}
function calculateSalesTax(price) {
return price + price*0.2;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Change to this option?
function calculateSalesTax(sales) {
let tax = sales * 0.2;
let total = sales + tax;
return total;
}

Comment thread mandatory/4-tax.js

}
console.log(addTaxAndFormatCurrency(40))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider this option. function addTaxAndFormatCurrency(sales) {
return "£" + calculateSalesTax(sales).toFixed(2);
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants