Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NW6/Sabella Fissha/js1/week1 #144

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Sabella-8
Copy link

@Sabella-8 Sabella-8 commented Nov 15, 2023

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

I HAVE DONE ALL THE EXERCISES

Copy link

@BakhatBegum BakhatBegum left a comment

Choose a reason for hiding this comment

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

Great job keep it up!

Comment on lines +1 to +3
// We don't want the computer to run these 2 lines - how can we solve this problem?
// we can comment out , the thing we don't want he computer to run it.

Choose a reason for hiding this comment

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

Well done! You have accurately performed the required task. I noticed a spelling error to correct.

Comment on lines +3 to 4
let age = 33;
age = age + 1;

Choose a reason for hiding this comment

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

👍

Comment on lines 3 to +4
const cityOfBirth = "Bolton";
console.log(`I was born in ${cityOfBirth}`);
Copy link

@BakhatBegum BakhatBegum Nov 15, 2023

Choose a reason for hiding this comment

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

Great job, keep it up!

@@ -1,6 +1,6 @@
const cardNumber = 4533787178994213;
let cardNumber = "4533787178994213";
Copy link

@BakhatBegum BakhatBegum Nov 15, 2023

Choose a reason for hiding this comment

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

You did well, using numbers as a string.

Comment on lines +1 to +2
const twentyfourHourClockTime = "08:53";

Choose a reason for hiding this comment

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

👍

Comment on lines +15 to +20
// --> 5 function calls.
// --> Number
// --> ReplceAll
// --> Number
// --> ReplaceAll
// --> percentageChange

Choose a reason for hiding this comment

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

Well done!

Comment on lines +25 to +28
// --> let carPrice = "10,000";
// --> let priceAfterOneYear = "8,543";
// --> const priceDifference = carPrice - priceAfterOneYear;
// --> const percentageChange = (priceDifference / carPrice) * 100;

Choose a reason for hiding this comment

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

👍

Comment on lines +18 to +19
// b) How many function calls are there?
// --> There is no function call.

Choose a reason for hiding this comment

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

👍

Comment on lines +31 to +33
// --> Division by zero.
// --> Floating numbers (decimal).
// --> The result will be unknown.

Choose a reason for hiding this comment

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

You did great i appreciate your job. In my point of view, it is infinity. because 0 / by something will be infinity.

Comment on lines +29 to +41
// 1. const penceString = "399p": initializes a string variable with the value "399p"
// 2. penceString.length = 4 : total number of count of a string.
// 3. penceString.length - 1 = 3
// 4. penceString.substring(0,penceString.length - 1); -> penceString.substring(0,3)
// 5. penceString.substring(0,3); = 399: it selects character between (0,3) so it remove "p".
// 6. penceStringWithoutTrailingP.padStart(3, "0"); : 399 has already 3 character and the padStart ask to add "o" upto having three digit.
// 7. paddedPenceNumberString = 399;
// 8. paddedPenceNumberString.length - 2 = 1;
// 9. pound = paddedPenceNumberString.substring( 0,1) = 3;
// 10. paddedPenceNumberString.substring(paddedPenceNumberString.length - 2)--> paddedPenceNumberString.substring(3 - 2)
// 11. 399.paddedPenceNumberString.substring(3 - 2)= 99;
// 12. pence= 99.padEnd(2,"0")--> 99 has already 2 digit so no need to add "0";
// 13. console.log(`£${pounds}.${pence}`);= 3.99;

Choose a reason for hiding this comment

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

Excellent, well done!

@@ -1,6 +1,7 @@
let firstName = "Creola";
let middleName = "Katherine";
let lastName = "Johnson";

const initials = firstName.charAt(0)+ middleName.charAt(0) + lastName.charAt(0)
Copy link
Member

Choose a reason for hiding this comment

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

Be careful of the requirement "in upper case". Even though the initials are all uppercase in this example, that might not be true for all inputs.

// --> ReplceAll
// --> Number
// --> ReplaceAll
// --> percentageChange
Copy link
Member

Choose a reason for hiding this comment

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

All great except the last one, percentageChange is only a variable


// b) How many function calls are there?
// b) How many function calls are there?
// --> There is no function call.
Copy link
Member

Choose a reason for hiding this comment

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

console.log(..) could be considered a function call

Copy link
Member

@JayMayer JayMayer left a comment

Choose a reason for hiding this comment

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

Great pull request Sabella!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants