Skip to content

Conversation

AdnaanA
Copy link

@AdnaanA AdnaanA commented Sep 25, 2025

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

Completed Coursework/sprint 1 by fixing code, testing code and making sure the code is functional, and answering questions regarding functionality of code.

Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes)

1 similar comment
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes)

Copy link

Your PR couldn't be matched to an assignment in this module.

Please check its title is in the correct format, and that you only have one PR per assignment.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes)

1 similar comment
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes)

@AdnaanA AdnaanA added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 25, 2025
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes)

1 similar comment
Copy link

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes)

@AdnaanA AdnaanA changed the title London | 25-ITP-Sep | Adnaan Abo | Structuring-and-Testing-Data Sprint 1 | Coursework/sprint 1 London | 25-ITP-Sep | Adnaan Abo | Sprint 1 | Coursework/sprint 1 Sep 25, 2025
@AdnaanA AdnaanA added the 📅 Sprint 1 Assigned during Sprint 1 of this module label Sep 25, 2025
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Oct 6, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good start on this sprint's tasks, I have spotted a few areas where you could improve code further

// Read the code and then answer the questions below

// a) How many function calls are there in this file? Write down all the lines where a function call is made
// there are 5 function calls in this file, they are on lines 1, 2, 5, 6 and 9

Choose a reason for hiding this comment

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

Are you sure these numbers are correct? How are you identifying function calls?

Copy link
Author

Choose a reason for hiding this comment

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

Hello,

Thank you for the feedback.

there are 5 function calls and, they are on lines 4, 5, and 10
function calls: replaceAll(), replaceAll(), Number(), Number(), console.log()

// the variable reassignment statements are on lines 5 and 6

// d) Identify all the lines that are variable declarations
// the variable declaration statements are on lines 1, 2, 4, 7 and 8

Choose a reason for hiding this comment

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

What is the variable declaration on line 4?

Copy link
Author

Choose a reason for hiding this comment

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

There is no variable declaration on line 4. there are only 4 variable declarations

the variable declaration statements are on lines 1, 2, 7 and 8
The variable declarations are: let carPrice, let priceAfterOneYear, const priceDifference, const percentageChange

// the error was coming from line 5 there was a comma missing between the 2 quotations ("," "") by adding the comma the code was fixed and it worked as it should.

// c) Identify all the lines that are variable reassignment statements
// the variable reassignment statements are on lines 5 and 6

Choose a reason for hiding this comment

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

Are you sure these are the correct lines? How are you counting the lines?

Copy link
Author

Choose a reason for hiding this comment

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

The variable reassignments are on lines 4 and 5

The variable reassignments are: carPrice = Number(carPrice.replaceAll(",", "")), priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", "")).

// there are 6 variable declarations in this program. They are on lines 1, 3, 4, 6, 7 and 9

// b) How many function calls are there?
// there are 2 function calls in this program. They are on lines 9 and 10

Choose a reason for hiding this comment

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

Which functions are called on lines 9 and 10?

Copy link
Author

Choose a reason for hiding this comment

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

Hello,

Thank you for the feedback there is only one function call in the script in question and the function call is in line 10 and the function call is console.log(result);

seconds and then dividing that result by 60.*/

// e) What do you think the variable result represents? Can you think of a better name for this variable?
/* the variable result represents the total length of the movie in hours, minutes and seconds. A better name for this variable could

Choose a reason for hiding this comment

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

Is it clear what the difference is between movieDuration and movieLength? Could I understand the difference by quickly reading these two variable names?

Copy link
Author

@AdnaanA AdnaanA Oct 6, 2025

Choose a reason for hiding this comment

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

Not really — they could easily be confused, especially in a larger codebase where someone is scanning quickly.

we can change movieDuration to something like formattedmovieDuration

be movieDuration.*/

// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
// yes this code will work for all values of movieLength as long as the value is a non-negative integer representing the length of a movie in seconds.

Choose a reason for hiding this comment

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

Are you sure there are no values that might give unexpected or oddly formatted output?

Copy link
Author

Choose a reason for hiding this comment

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

The code will work correctly, but it can produce unexpected or oddly formatted output in terms of readability, especially for values less than 10.

Expected value: 02:09:44
current code value: 2:9:44

@LonMcGregor LonMcGregor 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Oct 6, 2025
@AdnaanA AdnaanA added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 6, 2025
@LonMcGregor
Copy link

Thanks for making those clarifications, this task is now complete

@LonMcGregor LonMcGregor removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 6, 2025
@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 6, 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 all review comments have been addressed. 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants