Skip to content

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Structuring and Testing Data#1073

Open
Richiealx wants to merge 18 commits intoCodeYourFuture:mainfrom
Richiealx:coursework/sprint-1
Open

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Structuring and Testing Data#1073
Richiealx wants to merge 18 commits intoCodeYourFuture:mainfrom
Richiealx:coursework/sprint-1

Conversation

@Richiealx
Copy link

@Richiealx Richiealx commented Feb 26, 2026

Learners, PR Template

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

Changelist

Completed Sprint 1 coursework:

  • Key exercises completed
  • Mandatory errors analysed and explained in answers.md
  • Mandatory interpret section completed
  • Stretch exploration completed
  • Learning log updated

Thanks for the feedback @cjyuan!

Answers to follow-up questions

Programming term for count = count + 1

The one-word programming term is increment.
The statement increases the value stored in the variable by 1 and assigns the updated value back to the same variable.
This pattern is very common and can also be written using shorthand operators such as count += 1; or count++;.

Is .padEnd(2, "0") necessary?

Yes, .padEnd(2, "0") is needed to handle cases where the pence value has fewer than two digits.

For example:

  • If penceString = "5p", removing "p" gives "5"
  • substring(length - 2) would return "5" (only one digit)

Without .padEnd(2, "0"), the output would be £0.5.
With .padEnd(2, "0"), it becomes £0.50.

So .padEnd ensures the pence part always contains exactly two digits, which is required for correct currency formatting.

@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 26, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Very clear explanation and answers! I just have two follow-up questions.

@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 Feb 26, 2026
@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 13, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 13, 2026

Explanations are spot on. Well done!

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 13, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants