Skip to content

Add ReturnOnInvestment to math#1318

Open
InukaWijerathna wants to merge 1 commit into
williamfiset:masterfrom
InukaWijerathna:add/return-on-investment
Open

Add ReturnOnInvestment to math#1318
InukaWijerathna wants to merge 1 commit into
williamfiset:masterfrom
InukaWijerathna:add/return-on-investment

Conversation

@InukaWijerathna
Copy link
Copy Markdown

Description

Adds ReturnOnInvestment to the math package.

ROI is a fundamental financial metric — it quantifies how profitable an investment is relative to its cost as a simple percentage:

ROI = (Gain - Cost) / Cost × 100

What's included

  • ReturnOnInvestment.java — clean implementation with Javadoc, throws IllegalArgumentException for non-positive cost, and a main() with sample outputs

Checklist

  • Matches the existing code style (package declaration, Javadoc, main() demo)
  • Throws IllegalArgumentException for invalid input
  • Sample outputs in main() showing expected values

Reference: https://www.investopedia.com/terms/r/returnoninvestment.asp

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.

1 participant