Skip to content

Sprint 2 #146

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

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

Sprint 2 #146

wants to merge 32 commits into from

Conversation

Della-Bella
Copy link

LONDON | GISLAINE_DELLA_BELLA | MODULE-STRUCTURING-AND-TESTING-DATA | SPRINT-2

Self checklist

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

Questions

Hello Volunteer, good morning
Here are my exercises for review.
Thank you for taking the time to review them. I appreciate it,
Gislaine

@Della-Bella Della-Bella added the Needs Review Participant to add when requesting review label Nov 15, 2024
Copy link
Member

@SallyMcGrath SallyMcGrath left a comment

Choose a reason for hiding this comment

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

Hi there @Della-Bella

Oh, I think we already hit this problem on another PR. This is still quite mixed up, so please ask to pair with someone to go through opening a PR, branching, and checking what it is actually in your commit before you push it. You'll get it, don't worry!

@SallyMcGrath SallyMcGrath added 👀 Review Git Changes requested to do with Git Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Nov 18, 2024
Copy link
Member

@SallyMcGrath SallyMcGrath left a comment

Choose a reason for hiding this comment

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

Thanks for your hard work here, @Della-Bella .

I think it would be a good idea to spend a bit more time on this. There are some foundational concepts that you need to work on here. Book some time in with me or with another volunteer in the pair programming channel and we can walk through this coursework step by step.

You can do this. You will get there.


DEBUG*/

//The result of multiplying 10 and 32 is 320
Copy link
Member

Choose a reason for hiding this comment

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

Did this prediction bear out, or did it print undefined? Why did it do this?

Copy link
Author

Choose a reason for hiding this comment

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

The function wasn't called initially, so it didn't display the result. However, it has now been called and is returning the result.

//FIX://

function sum(a, b) {
return; a + b;
Copy link
Member

Choose a reason for hiding this comment

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

When you executed this function, did this fix work? 🤔

Copy link
Author

Choose a reason for hiding this comment

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

This fix didn't work because the sum of "a" and "b" wasn't included. Now I have fixed the code, and it is returning the result.

// This program should tell the user the last digit of each number.
// Explain why getLastDigit is not working properly - correct the problem
/* This program should tell the user the last digit of each number.
the function doesn’t have a parameter to receive the num variable it’s trying to process.
Copy link
Member

Choose a reason for hiding this comment

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

This is true, but not complete. It doesn't have a parameter, so why is it returning 3? Where does the 3 come from?

Copy link
Author

Choose a reason for hiding this comment

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

The function was using the same variable every time. Adding a parameter to the function fixed it.T

@@ -3,11 +3,14 @@
// Why will an error occur when this program runs?
// Try playing computer with the example to work out what is going on
Copy link
Member

Choose a reason for hiding this comment

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

What do you think? Why is this happening? What is the fix?

Copy link
Author

Choose a reason for hiding this comment

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

Remove the duplicated declaration. With this commit



/* this function should square any number but instead we're going to get an error
Fix 3 is not valid parameter name. should change function name to square(num)
Copy link
Member

Choose a reason for hiding this comment

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

What is the error, specifically?

Copy link
Author

Choose a reason for hiding this comment

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

The error was with parameter 3, which always gave me the same result. By changing it to "num," the function now works with any number. Also 3 is used as the parameter name for the function, which is not valid in JavaScript.

@@ -13,3 +13,24 @@
// Given someone's weight in kg and height in metres
// Then when we call this function with the weight and height
// It should return their Body Mass Index to 1 decimal place


function ibmCalculator() {
Copy link
Member

Choose a reason for hiding this comment

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

What would happen if you had a different height or weight?

Copy link
Author

Choose a reason for hiding this comment

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

I understand now why it was giving the same results. I removed the constant from inside the function and fixed the height units.

Copy link
Author

Choose a reason for hiding this comment

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

Fix the units/ removed the constant values

`current output: ${currentOutput}, target output: ${targetOutput}`
);*/

function formatAs12HourClock(time) {
Copy link
Member

Choose a reason for hiding this comment

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

What would happen if the time was in the afternoon?

Copy link
Author

Choose a reason for hiding this comment

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

It wouldn't work. Fix the function to the 12 hours format.

@Della-Bella Della-Bella added the Complete Volunteer to add when work is complete and review comments have been addressed label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed 👀 Review Git Changes requested to do with Git Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants