-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: main
Are you sure you want to change the base?
Conversation
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.
Great job keep it up!
// 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. |
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.
Well done! You have accurately performed the required task. I noticed a spelling error to correct.
let age = 33; | ||
age = age + 1; |
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.
👍
const cityOfBirth = "Bolton"; | ||
console.log(`I was born in ${cityOfBirth}`); |
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.
Great job, keep it up!
@@ -1,6 +1,6 @@ | |||
const cardNumber = 4533787178994213; | |||
let cardNumber = "4533787178994213"; |
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.
You did well, using numbers as a string.
const twentyfourHourClockTime = "08:53"; |
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.
👍
// --> 5 function calls. | ||
// --> Number | ||
// --> ReplceAll | ||
// --> Number | ||
// --> ReplaceAll | ||
// --> percentageChange |
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.
Well done!
// --> let carPrice = "10,000"; | ||
// --> let priceAfterOneYear = "8,543"; | ||
// --> const priceDifference = carPrice - priceAfterOneYear; | ||
// --> const percentageChange = (priceDifference / carPrice) * 100; |
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.
👍
// b) How many function calls are there? | ||
// --> There is no function call. |
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.
👍
// --> Division by zero. | ||
// --> Floating numbers (decimal). | ||
// --> The result will be unknown. |
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.
You did great i appreciate your job. In my point of view, it is infinity. because 0 / by something will be infinity.
// 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; |
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.
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) |
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.
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 |
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.
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. |
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.
console.log(..)
could be considered a function call
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.
Great pull request Sabella!
Learners, PR Template
Self checklist
I HAVE DONE ALL THE EXERCISES