Skip to content

West Midlands | 26 March SDC | Iswat Bello | Sprint 2 | jq exercises#410

Open
Iswanna wants to merge 5 commits intoCodeYourFuture:mainfrom
Iswanna:tools/sprint2-jq-exercises
Open

West Midlands | 26 March SDC | Iswat Bello | Sprint 2 | jq exercises#410
Iswanna wants to merge 5 commits intoCodeYourFuture:mainfrom
Iswanna:tools/sprint2-jq-exercises

Conversation

@Iswanna
Copy link
Copy Markdown

@Iswanna Iswanna commented Mar 21, 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

This pull request adds a series of Bash scripts that use jq to extract and process data from person.json and scores.json. Each script addresses a specific requirement, such as extracting names, formatting addresses, listing player stats, and calculating score totals.

Questions

Hi, could you please review my PR? I would really appreciate your feedback.

Iswanna added 4 commits March 19, 2026 20:26
- script-01.sh: Output the person's name without quotes.
- script-02.sh: Output the person's address as a single comma-separated line without quotes.
- script-03.sh: Output the person's name and profession in the required format.
- script-04.sh: Output each player's name on a separate line as required.
…es.json

- script-05.sh: Output each player's name and city on one line.
- script-06.sh: Output each player's name and their first score.
- script-07.sh: Output each player's name and their last score.
- script-08.sh: Output each player's name and number of games played.
- script-09.sh: Output each player's name and total score.
- script-10.sh: Output the sum of all players' first scores.
- script-11.sh: Output the sum of all scores from all games and players.
@Iswanna Iswanna added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Tools The name of the module. labels Mar 21, 2026
@nedssoft nedssoft added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Apr 11, 2026
Copy link
Copy Markdown

@nedssoft nedssoft left a comment

Choose a reason for hiding this comment

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

Good job in completing the exercises. The comment I left are good to haves as the requirements are already met.

Comment thread jq/script-05.sh Outdated
Comment on lines +8 to +9

jq -r '.[] | "\(.name) \(.city)"' ./scores.json No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you think of another way to achieve the same without the slashes and brackets to improve readability?

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.

Yes, one simpler option is jq -r '.[] | .name + " " + .city' ./scores.json

Comment thread jq/script-06.sh Outdated
Comment on lines +10 to +14
jq -r '.[] | "\(.name) \(.scores[0])"' scores.json




Copy link
Copy Markdown

Choose a reason for hiding this comment

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

same as above

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.

Yes, one simpler option is jq -r .[] | .name + " " + (.scores[0] | tostring)' scores.json

Comment thread jq/script-07.sh Outdated
Comment on lines +9 to +10

jq -r '.[] | "\(.name) \(.scores[-1])"' scores.json
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same as above

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.

Yes, one simpler option is jq -r '.[] | .name + " " + (.scores[-1] | tostring)' scores.json

@nedssoft nedssoft added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 11, 2026
@Iswanna
Copy link
Copy Markdown
Author

Iswanna commented Apr 13, 2026

Thank you, @nedssoft, for the code review.

- script-05.sh: Replace string interpolation with + operator for name and city
- script-06.sh: Use string concatenation and tostring for name and first score
- script-07.sh: Use string concatenation and tostring for name and last score
- All scripts maintain the same output format
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. Module-Tools The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants