Previous
0 / 11
Module DEMO-33-62DEMO-OOP-33

Simple Interest Projection

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read principal, annual rate, and number of years, then print the simple interest projection.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. principal amount
  2. interest rate
  3. number of years

Output Format

Print the exact report in this order:

  1. Interest
  2. Total

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
1000.0
5.0
2
Interest: 100.00
Total: 1100.00
Input: principal amount = 1000.0, interest rate = 5.0, number of years = 2.
Key calculation(s): interest = 1000.0 * (5.0 / 100.0) * 2 | total = 1000.0 + interest | "Interest: " + String.format("%.2f", interest) = "Interest: 100.00".
Output:
Interest: 100.00
Total: 1100.00
Sample #2
Public sample
500.0
7.5
1
Interest: 37.50
Total: 537.50
Input: principal amount = 500.0, interest rate = 7.5, number of years = 1.
Key calculation(s): interest = 500.0 * (7.5 / 100.0) * 1 | total = 500.0 + interest | "Interest: " + String.format("%.2f", interest) = "Interest: 37.50".
Output:
Interest: 37.50
Total: 537.50

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings