Skip to content

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Object Destructuring#395

Open
Richiealx wants to merge 5 commits intoCodeYourFuture:mainfrom
Richiealx:feature/destructuring
Open

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Object Destructuring#395
Richiealx wants to merge 5 commits intoCodeYourFuture:mainfrom
Richiealx:feature/destructuring

Conversation

@Richiealx
Copy link
Copy Markdown

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

This PR completes the Object Destructuring exercises for Sprint 1.

  • Exercise 1: Used object destructuring in the function parameter to extract name, age, and favouriteFood
  • Exercise 2: Used object destructuring to:
    • display Gryffindor students
    • display teachers who have pets
  • Exercise 3: Used object destructuring to:
    • calculate item totals
    • print a formatted receipt
    • calculate and display the final total

All exercises were tested using Node.js and outputs match the expected results.

@github-actions

This comment has been minimized.

@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 3, 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 Apr 3, 2026
@Richiealx Richiealx changed the title Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Data Flows Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 1 | Object Destructuring Apr 3, 2026
@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 3, 2026
total += itemTotal;

console.log(
`${itemName} x${quantity} = £${(itemTotal / 100).toFixed(2)}`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The output format does not match requirements

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The output is still not the same.

You can use a diff tool to compare your output and the expected results:

QTY    ITEM             TOTAL
1     Hot cakes        2.32
2     Apple Pie        2.78
1     Egg McMuffin     2.80
1     Sausage McMuffin 3.00
2     Hot Coffee       2.00
4     Hash Brown       1.60

Total: 14.50
QTY     ITEM                TOTAL
1       Hot Cakes           2.32
2       Apple Pie           2.78
1       Egg McMuffin        2.80
1       Sausage McMuffin    3.00
2       Hot Coffee          2.00
4       Hash Brown          1.60

Total: 14.50

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 for the feedback. I have now adjusted the formatting, spacing, and capitalisation so that the output matches the expected result exactly. I re-ran the file in Node.js and confirmed the output now aligns with the task requirements.

@Luro91 Luro91 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 Apr 10, 2026
@Richiealx
Copy link
Copy Markdown
Author

Thank you for the review. I updated the destructuring exercises and fixed Exercise 3 so the output format now matches the task requirements more closely. I also re-tested all three exercises in Node.js.

@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 11, 2026
@Luro91 Luro91 removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 12, 2026
@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 12, 2026
Copy link
Copy Markdown

@Luro91 Luro91 left a comment

Choose a reason for hiding this comment

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

Well done. The formatting is correctly now

@Luro91 Luro91 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. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 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