-
-
Notifications
You must be signed in to change notification settings - Fork 482
London10-SAQIB_JAVED-JavaScript-Core-1-Coursework-week1 #523
base: master
Are you sure you want to change the base?
Conversation
mandotary exercise completed. will update my extra exercixes.
@@ -5,7 +5,9 @@ | |||
Sales tax is 20% of the price of the product. | |||
*/ | |||
|
|||
function calculateSalesTax() {} | |||
function calculateSalesTax(price) { | |||
return price + (price / 100) * 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Saqib , i'm doing a code review as part of homework .
What i would suggest is in case you want a more simple code you could use just return price + (price *0.2) .
But great job either way .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bedi06 thanks for your feedback.
piping and 8 ball magic not working as expected.
8 ball completed piping.js not working
all test working
function introduceMe(name, age) | ||
return `Hello, my {name}` is "and I am $age years old`; | ||
function introduceMe(name, age) { | ||
return `Hello, my name is ${name} and I am ${age} years old`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 😄
@@ -1,16 +1,15 @@ | |||
// The syntax for these functions is valid but there are some errors, find them and fix them | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on all of these 👍
function combine2Words(word1, word2) { | ||
return word1.concat(word2); | ||
} | ||
|
||
function concatenate(firstWord, secondWord, thirdWord) { | ||
return firstWord.concat(" ", secondWord, " ", thirdWord); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
Can you thing of any other ways to do this?
Here are some ideas: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your feed back @moneyinthesky . i will look at this
@@ -17,7 +19,10 @@ function calculateSalesTax() {} | |||
Remember that the prices must include the sales tax (hint: you already wrote a function for this!) | |||
*/ | |||
|
|||
function addTaxAndFormatCurrency() {} | |||
function addTaxAndFormatCurrency(price) { | |||
let Price = calculateSalesTax(price); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but you might think about the name of this variable Price
. Having 2 variables with very similar names (price
and Price
) might be confusing for other developers 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks thats evdn confusing for me too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tired to give another name before, it wasn’t working then after few tries i put price to make it working
function convertToBRL(currency) { | ||
let priceAfterFee = currency * 0.99; | ||
let priceInBRL = priceAfterFee * 5.7; | ||
return Math.round(priceInBRL * 100) / 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👍
|
||
/* BETTER PRACTICE */ | ||
|
||
let goodCode = | ||
let goodCode = format(multiply(add(startingValue, 10), 2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth thinking about how you can make this easier to read.
Maybe we can do each part on a different line, and assign the result to a variable?
@@ -45,8 +45,53 @@ | |||
|
|||
// This should log "The ball has shaken!" | |||
// and return the answer. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice solution on this one 😃
fixed my extras - piping
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 repositoryYour Details
Homework Details
Notes
What did you find easy?
What did you find hard?
What do you still not understand?
Any other notes?