Calculate the simple interest given principal amount, annual interest rate (as a percentage), and time period in years. Return the interest amount rounded to 2 decimal places.

Formula: Simple Interest = (Principal × Rate × Time) / 100

Examples:

Input: principal = 1000, rate = 5, years = 2 Output: 100.00 Explanation: (1000 × 5 × 2) / 100 = 100.00 Input: principal = 5000, rate = 8.5, years = 3 Output: 1275.00 Explanation: (5000 × 8.5 × 3) / 100 = 1275.00 Input: principal = 0, rate = 10, years = 5 Output: 0.00 Explanation: Principal is 0, so interest is 0
Apex Code Editor

Welcome to Lightning Challenge!

How It Works

  • • Write your solution in the code editor
  • • Connect your Salesforce org to test
  • • Submit to check if your solution passes
  • • Use hints if you get stuck

Contest Alert

🏆 #CodeEveryDay November 2026 (Nov 16–30)Sponsored by FLXBL

Contest runs November 16 - 30. Complete challenges to climb the leaderboard!

Prizes 1 & 2: Salesforce certification exam voucher — won by random drawing, where every point is a ticket. see all prizes

Only the 15 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In