This repository was archived by the owner on Jan 14, 2024. It is now read-only.
London Class 10- Elena Barker - JS1 - Week 2#455
Open
ElenaBarker wants to merge 4 commits intoCodeYourFuture:mainfrom
Open
London Class 10- Elena Barker - JS1 - Week 2#455ElenaBarker wants to merge 4 commits intoCodeYourFuture:mainfrom
ElenaBarker wants to merge 4 commits intoCodeYourFuture:mainfrom
Conversation
task done
first task done
Mandatory tasks done
printOddNumbers updated
| @@ -10,8 +10,8 @@ | |||
|
|
|||
| */ | |||
|
|
|||
Contributor
There was a problem hiding this comment.
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) {} |
Contributor
There was a problem hiding this comment.
Nice! I think you could simplify the code in a few ways...
- If you have an
ifstatement 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
ifstatement? Maybe you can write it with only areturnstatement?
| is applieds and 142.5 should be returned) | ||
| */ | ||
|
|
||
| function applyDiscount(totalPrice) {} |
| /* | ||
| Complete the function to print to the console the odd numbers between 1 and limit (use a while loop): | ||
| */ | ||
| function printOddNumbers(limit) {} |
| 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) {} |
Contributor
There was a problem hiding this comment.
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" | ||
| */ |
Contributor
There was a problem hiding this comment.
These look good as well!
Contributor
|
Great job on this coursework @ElenaBarker! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in
HOW_TO_MARK.mdin 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?