Skip to content

Cape Town | 25-ITP-May | Asanda Dunn | Sprint 2 | Coursework/sprint2#1418

Open
asandagwala wants to merge 12 commits into
CodeYourFuture:mainfrom
asandagwala:acoursework/sprint-2
Open

Cape Town | 25-ITP-May | Asanda Dunn | Sprint 2 | Coursework/sprint2#1418
asandagwala wants to merge 12 commits into
CodeYourFuture:mainfrom
asandagwala:acoursework/sprint-2

Conversation

@asandagwala

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Module: Structure and testing data Sprint 2 work

@asandagwala asandagwala added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Jun 27, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 27, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@asandagwala asandagwala changed the title Cape Town | 25-ITP-May | Asanda Dunn | Sprint 1 | Coursework/sprint2 Cape Town | 25-ITP-May | Asanda Dunn | Sprint 2 | Coursework/sprint2 Jun 27, 2026
@asandagwala asandagwala added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 29, 2026
// =============> write your new code here

function multiply(a,b){
return(a*b);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return a * b; would be enough.

The general syntax of the return statement is:

  return expression;

And the value of expression is returned.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you, I have implemented the reommended changes

Comment thread Sprint-2/3-mandatory-implement/1-bmi.js Outdated

function calculateBMI(weight, height) {
let bmi = weight/(height *height)
return `${bmi.toFixed(1)}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What type of value do you expect your function to return? A number or a string?
Does your function return the type of value you expect?

Different types of values may appear identical in the console output, but they are represented and treated differently in the program. For example,

  console.log(123);              // Output 123
  console.log("123");            // Output 123
  
  // Treated differently in the program
  let sum1 = 123 + 100;         // Evaluate to 223 -- a number
  let sum 2 = "123" + 100;      // Evaluate to "123100" -- a string.

Note:

return `${bmi.toFixed(1)}`;

is the same as

return bmi.toFixed(1);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have corrected my mistake. Thank you so much

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you also answer these questions?

What type of value do you expect your function to return? A number or a string?
Does your function return the type of value you expect?

Comment thread Sprint-2/3-mandatory-implement/2-cases.js Outdated
Comment thread Sprint-2/3-mandatory-implement/2-cases.js Outdated
Comment on lines +27 to +28
const result = `£${pounds}.${pence}`;
return result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code is not properly formatted.

Have you installed the prettier VSCode extension and enabled "Format on save/paste" on VSCode,
as recommended in
https://github.com/CodeYourFuture/Module-Structuring-and-Testing-Data/blob/main/readme.md
?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have used prettier for formatting, I am not sure why the formatting could be improper. I have attached a screenshot of what it looks like on my end. Please let me know how I can correct prettier or update the settings to make it work properly
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's good that you have installed prettier and know how to format code.

The code you showed in the screenshot is not the the file I was referring to.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

My apologies, please see the correct code as referenced in your comment
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is how the code looks like on my VSCode.

image

If you haven't enabled format on save, you would need to manually use the "Format document" option to apply the formatter to format the code. And if you have more than one formatters installed, you may need to choose a default formatter for the "format on save" to work properly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not complete the implementation of the formatAs12HourClock() function? It's a good programming exercise.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I did complete the formatAs12HourClock(), maybe I did not commit the work done on that file. Please check again if you are able to see it from your end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't see the implementation of this functio on GitHub. I also don't see the changes you said you made in Sprint-2/2-mandatory-debug/0.js.

You could click the "Files changed" tab on your PR on GitHub to see what files are changed on GitHub. That's also typically how the code reviewer views the changes in a PR.
image

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants