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

Conversation

Stelladelmar
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:
  • 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?

//from 7 to 1
let number = 7;
function countReverse(number) {
while (number >= 10 ){

Choose a reason for hiding this comment

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

So for this one, using a while loop where will probably result in an infinite loop (more on this here), if the number is greater than 10. Otherwise, this will not run as the number would be less than 10 (for example in your number = 7 example, this wouldn't return anything because the number is less than 10).

You might want to think about using a for loop here:

for (let i = number; i > 0; i--)

else if (age >= 90 ){
return "You Don't Need To Register"; }

}

Choose a reason for hiding this comment

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

Awesome! nice work on this one 🎉

} else if (price2 > price1){
return price2;
}
//console.log("price is");
Copy link

@kwebster77 kwebster77 Mar 31, 2023

Choose a reason for hiding this comment

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

nice job using an if statement here.

LGTM! (here is the meaning if this acronym!)

while (limit <= 10){
console.log(limit);
} limit = limit + 1;
}

Choose a reason for hiding this comment

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

Looks like we might have another infinite loop here (docs here). Maybe have a quick review on how while loops work? they can be a bit tricky.

//let totalPrice = 150;
function applyDiscount(totalPrice) {
if (totalPrice >200){
return (totalPrice - totalPrice * 0.01);

Choose a reason for hiding this comment

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

nice job with the if statement!

Just might want to check your maths on this one 😉
0.01 would be 1% and 0.1 would be a 10%, but where is our 5% discount? 😜

Copy link
Author

Choose a reason for hiding this comment

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

Thanks. I understand 😅

return true;
} else {
return false;
}

Choose a reason for hiding this comment

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

Nice one!

@kwebster77
Copy link

Hi @Stelladelmar! Thanks for putting in this PR! That's great :) Very happy you were able to get this in and a lot of really good work! I can see you have really been practicing. I have left some comments for you. The one thing I would say you might want to take another look at is your while loops. We can review this concept if you have any questions, but in the meantime take a look back through the videos and some of the documentation.

Again, great work and keep it up! Looking forward to your next one :)

@kwebster77 kwebster77 added the reviewed A mentor has reviewed this code label Mar 31, 2023
@Stelladelmar Stelladelmar changed the title ✌🏼1st London10-StellaDelMar_RodriguezFernandez-JavaScript-Core-1-Coursework-Week2 May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

reviewed A mentor has reviewed this code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants