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

London10-SAQIB_JAVED-JavaScript-Core-1-Coursework-week1 #523

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

saqibjvd
Copy link

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: saqib javed
  • Your City: london
  • Your Slack Name: saqibjvd

Homework Details

  • Module:
  • Week:

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?

completed mandatory  exercises ,
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;
Copy link

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 .

Copy link
Author

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`;
Copy link
Contributor

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

Copy link
Contributor

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);
Copy link
Contributor

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

Copy link
Author

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);
Copy link
Contributor

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 😄

Copy link
Author

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

Copy link
Author

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;
Copy link
Contributor

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));
Copy link
Contributor

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.

Copy link
Contributor

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants