-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
WM5 | Karam Ali | Module-JS1 | Week 2 #88
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 work keep going!
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.
well done!
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 Work
// This is just an instruction for the first activity - but it is just for human consumption | ||
// We don't want the computer to run these 2 lines - how can we solve this problem? |
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.
Welldone
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.
Welldone
const twelveHourClockTime = "20:53"; | ||
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.
Weldone
week-2/implement/to-pounds.js
Outdated
|
||
console.log(toPounds("499p")); | ||
console.log(toPounds("293p")); | ||
console.log(toPounds("27p")); |
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 work!
// Then when we call this function with the weight and height | ||
// It should return their Body Mass Index to 1 decimal place | ||
|
||
function bodyMassIndex(height, weight) { |
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.
Looking good :)
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 is a great start! Some answers are missing and you seem to have had a merge happen, this just needs cleaning up a bit.
@@ -25,12 +25,37 @@ console.log(formatTimeDisplay(143)); | |||
|
|||
// Questions | |||
|
|||
<<<<<<< HEAD |
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 seen to have this left over from a merge conflict!
@@ -25,12 +25,37 @@ console.log(formatTimeDisplay(143)); | |||
|
|||
// Questions | |||
|
|||
<<<<<<< HEAD | |||
// a) Run this program with node, identify the line the error is thrown. Explain why this error is occurring. How can you fix this error? |
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 answer seems to be from elsewhere?
// a) When formatTimeDisplay is called how many times will pad be called? | ||
|
||
// Call formatTimeDisplay with an input of 143, now answer the following: | ||
>>>>>>> 03fce56db903fb986ff36f73e4d57cebfa18707c | ||
|
||
// b) What value is assigned to the parameter num when pad is called for the first time? |
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 need to write an answer for this question!
|
||
// b) What value is assigned to the parameter num when pad is called for the first time? | ||
|
||
<<<<<<< HEAD | ||
// c) What is the value assigned to num when pad is called for the first time? | ||
// remainingHours |
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.
what is the value of remainingHours?
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 work keep going!
const percentage = `${decimalNumber * 100}%`; | ||
|
||
return percentage; | ||
} | ||
|
||
console.log(decimalNumber); | ||
|
||
console.log(convertToPercentage(0.7)); |
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.
What you did here is correct, however, you need to declare decimalNumber as a var and assign 0.7 to it, and then pass the "decimalNumber" into the function convertToPercentage instead of passing 0.7 straight.
|
||
console.log(square(3)); | ||
console.log(square(2)); | ||
console.log(square(4)); |
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!
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 work keep going!
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 work keep going!
|
||
console.log(toPounds("499p")); | ||
console.log(toPounds("293p")); | ||
console.log(toPounds("27p")); |
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 mate!
|
||
function priceWithVAT(price) { | ||
newPrice = price * 1.2; | ||
return `New price (20% VAT inclusive): £${newPrice}`; |
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.
Ideally, this should just return a number called newPrice
without any string/text before to it.
function multiply(a, b) { | ||
console.log(a * b); | ||
return a * b; | ||
} | ||
|
||
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); |
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 work
const myNameCapTest = capitalise("karam"); | ||
|
||
console.log(capitaliseTest); | ||
console.log(myNameCapTest); |
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.
LGTM
return `£${(Number(str.substring(0, str.length - 1)) / 100).toFixed(2)}`; | ||
} | ||
|
||
console.log(toPounds("499p")); |
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.
LGTM
Learners, PR Template
Changelist
Briefly explain your PR.
My completed exercises
Questions
Ask any questions you have for your reviewer.