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

WM5 | Karam Ali | Module-JS1 | Week 2 #88

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

Conversation

kayali436
Copy link

Learners, PR Template

Changelist

Briefly explain your PR.
My completed exercises

Questions

Ask any questions you have for your reviewer.

@kayali436 kayali436 changed the title Feature/week 2 exercises WM5 | Karam Ali | Module-JS1 | Week 2 Oct 10, 2023
Copy link

@AltomHussain AltomHussain left a 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;

Choose a reason for hiding this comment

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

well done!

Copy link

@olaoluwasalami olaoluwasalami left a 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?

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}`);

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";

Choose a reason for hiding this comment

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

Weldone


console.log(toPounds("499p"));
console.log(toPounds("293p"));
console.log(toPounds("27p"));

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

Choose a reason for hiding this comment

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

Looking good :)

Copy link

@Honestocean Honestocean left a 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

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?

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?

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

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?

Copy link

@AltomHussain AltomHussain left a 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));

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));

Choose a reason for hiding this comment

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

Well done!

Copy link

@AltomHussain AltomHussain left a 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!

Copy link

@AltomHussain AltomHussain left a 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"));

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}`;
Copy link

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)}`);

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);

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"));

Choose a reason for hiding this comment

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

LGTM

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.

6 participants