Skip to content

feat(sum.cpp): read two numbers and print their sum - #475

Open
Helias wants to merge 1 commit into
mainfrom
sum-exercise-2
Open

Helias wants to merge 1 commit into
mainfrom
sum-exercise-2

Conversation

@Helias

@Helias Helias commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Reads the numbers as double so decimals work too, e.g. 1.5 + 2.25 prints 3.75.

Summary by CodeRabbit

  • New Features
    • Added a program that prompts for two numbers and displays their sum.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
Generated by CodeRabbit — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 351c3376-0f50-45a7-a4c1-9084e5bbc011
📥 Commits

Reviewing files that changed from the base of the PR and between 59cb25f and 8104991.

📒 Files selected for processing (1)
  • exercises/sum.cpp

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds a main function that prompts for two double values, reads them, and prints their sum.

Changes

Sum Program

Layer / File(s) Summary
Read values and print their sum
exercises/sum.cpp
main prompts for and reads two double values, prints their sum, and returns 0.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 81049

The program handles the intended two-number sum flow, including decimal inputs; no actionable merge risk was identified.

Architecture Summary

Architecture risk: 🔵 Low · up to 81049

The change affects 1 system.

Changed systems: exercises

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — exercises (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in exercises/sum.cpp: Adds main, which prompts for and reads two double values, prints their sum, and returns 0.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: read two numbers and print their sum.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation correctly fulfills the documented exercise and supports decimal inputs.

Review effort: Balanced
Findings: None

What changed in this PR

Adds a standalone C++ exercise that reads two numbers and prints their sum.

Changes:

  • Supports decimal inputs using double.
  • Prompts for two values and displays their sum.
File Description
exercises/​sum.cpp Implements numeric input and sum output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants