-
-
Notifications
You must be signed in to change notification settings - Fork 481
London 9- Tuan Nguyen-JS-core1-week1 #534
base: master
Are you sure you want to change the base?
Conversation
Hi there @Jacknguyen4438, |
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.
Well done on getting your first piece of coursework done!
My main piece of feedback at this point is around variable names - how can you improve the naming of variables in order to convey more meaning in your programs.
@@ -17,7 +20,11 @@ function calculateSalesTax() {} | |||
Remember that the prices must include the sales tax (hint: you already wrote a function for this!) | |||
*/ | |||
|
|||
function addTaxAndFormatCurrency() {} | |||
function addTaxAndFormatCurrency(product) { | |||
let amountOne=( (product*1.2).toFixed(2)).toString(); |
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.
Hello @Jacknguyen4438 ,
Can you think of a better variable name than amountOne
? Think about the calculation you're doing here and what it means in order to help you come up with a clearer variable name. Remember your variable names should convey meaning, as your code will be read by other humans.
function addTaxAndFormatCurrency() {} | ||
function addTaxAndFormatCurrency(product) { | ||
let amountOne=( (product*1.2).toFixed(2)).toString(); | ||
// let amountTwo= parseFloat(amountOne); |
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.
👓 Remember to remove old comments
@@ -5,7 +5,10 @@ | |||
Sales tax is 20% of the price of the product. | |||
*/ | |||
|
|||
function calculateSalesTax() {} | |||
function calculateSalesTax(productPrice) { | |||
let productTotal=productPrice+(productPrice*0.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.
You have no spaces between the variable names and the expression on the right hand side. Double check the README
for instructions on how to format your code
This is my answer for the home work
Your Details
Homework Details
Notes
What did you find easy?using var key word and function syntax.
What did you find hard? How the test work
What do you still not understand?how to calculation in function
Any other notes?no