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

Manchester NW5-Yousef Shaikhan-JavaScript-Week1#398

Open
youweb3 wants to merge 2 commits intoCodeYourFuture:masterfrom
youweb3:master
Open

Manchester NW5-Yousef Shaikhan-JavaScript-Week1#398
youweb3 wants to merge 2 commits intoCodeYourFuture:masterfrom
youweb3:master

Conversation

@youweb3
Copy link
Copy Markdown

@youweb3 youweb3 commented Aug 27, 2022

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

Homework Details

  • Module: JavaScript
  • Week: 1

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?

function getRandomNumber() {
return Math.random() * 10;
}
// this function means return a random number between 0(inclusive), and 10(exclusive)
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 job adding the comments
Comments should'nt be added at the bottom of your code. that is bad practise

function combine2Words(word1, word2) {
return word1.concat(word2);
}
// the diffrent selection of the set of element taken one by one,or some join toghether
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 mistake here

Comment thread mandatory/4-tax.js

function calculateSalesTax() {}
function calculateSalesTax(price) {
return (price * 20) / 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.

This is nice.
First, you are not returning to the correct format with the £ symbol

@SteveLeicester
Copy link
Copy Markdown

Hi Yousef - thanks for submitting.
Did you check all your tests? A number are failing. See the comment on calculateSaleTax function. It says the price including sales tax. That means it needs to be added yes?

function calculateSalesTax(price) {
return (price + (price * 20) / 100);
}

Now you need to format too. Did you look at toFixed in class? You can combine functions...

function addTaxAndFormatCurrency(price) {
return "£" + calculateSalesTax(price).toFixed(2);
}

Also careful with concatenate. The test is asking for gaps between the strings
expect(concatenate("I ", "am ", 13)).toEqual("I am 13");

Good effort but with test driven development keep working until the test passes.

Steve

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