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

Conversation

ElenaBarker
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: Elena Barker
  • Your City: London
  • Your Slack Name: Elena

Homework Details

  • Module: JS1
  • Week: 2

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?

@ElenaBarker ElenaBarker added the review requested I would like a mentor to review my PR label Mar 22, 2023
NOTE:Only make edits inside the function
*/

Copy link
Contributor

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

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...

  1. 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?
  2. Can you think of a way to write this function without the if statement? Maybe you can write it with only a return statement?

is applieds and 142.5 should be returned)
*/

function applyDiscount(totalPrice) {}
Copy link
Contributor

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

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) {}
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 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"
*/
Copy link
Contributor

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!

@moneyinthesky
Copy link
Contributor

Great job on this coursework @ElenaBarker!
I think you might be able to do the extra exercise as well if you have time 😄

@moneyinthesky moneyinthesky added the reviewed A mentor has reviewed this code label Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

review requested I would like a mentor to review my PR reviewed A mentor has reviewed this code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants