-
-
Notifications
You must be signed in to change notification settings - Fork 437
London Class 10- Elena Barker - JS1 - Week 2 #455
base: main
Are you sure you want to change the base?
Conversation
task done
first task done
Mandatory tasks done
printOddNumbers updated
NOTE:Only make edits inside the function | ||
*/ | ||
|
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.
Both of these functions look good to me 👍
1. the user should be 18 or older | ||
2. the user must be logged in | ||
*/ | ||
function isAcceptableUser(userAge, isLoggedIn) {} |
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! I think you could simplify the code in a few ways...
- If you have an
if
statement that looks like this:if(isLoggedIn === true)
- you can write this instead:if(isLoggedIn)
- can you think of why that works? - Can you think of a way to write this function without the
if
statement? Maybe you can write it with only areturn
statement?
is applieds and 142.5 should be returned) | ||
*/ | ||
|
||
function applyDiscount(totalPrice) {} |
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.
Perfect!
/* | ||
Complete the function to print to the console the odd numbers between 1 and limit (use a while loop): | ||
*/ | ||
function printOddNumbers(limit) {} |
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.
Good job 👍
Complete the buyTwoGetTheCheapestFree function: if user buys two items, the cheapest item will be free! | ||
The function should return the price to be paid once the discount is applied. | ||
*/ | ||
function buyTwoGetTheCheapestFree(price1, price2) {} |
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 almost perfect.
Try to keep an eye on your indentation and spacing in the code. Even though it seems like it doesn't matter - it can make it much easier for other developers to read and understand your code 😄
- if the person is 12 or younger it should return "You Are Too Young To Register" | ||
- if the person is older than 12 and younger than 90 it should return "You Can Register" | ||
- if the person is 90 or older it should return "You Don't Need To Register" | ||
*/ |
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.
These look good as well!
Great job on this coursework @ElenaBarker! |
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?