Previous Next
0 / 15
Module DEMO-33-72DEMO-OOP-33

Savings Account Inheritance

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create an account base class and a savings-account subclass that prints the projected balance after interest.

Input Format

Input is given as whitespace-separated tokens for the base-class fields first, followed by the child-class fields.

Output Format

Print the exact multiline report required by the problem.

Sample Testcases

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

Sample #1
Public sample
Lina
100.0
5.0
Owner: Lina
Balance: 100.00
Projected Balance: 105.00
Input: account owner = "Lina", current balance = 100.0, interest rate = 5.0.
Key calculation(s): "Owner: " + "Lina" = "Owner: Lina" | "Balance: " + String.format("%.2f", 100.0) = "Balance: 100.00".
Output:
Owner: Lina
Balance: 100.00
Projected Balance: 105.00
Sample #2
Public sample
Omar
250.0
10.0
Owner: Omar
Balance: 250.00
Projected Balance: 275.00
Input: account owner = "Omar", current balance = 250.0, interest rate = 10.0.
Key calculation(s): "Owner: " + "Omar" = "Owner: Omar" | "Balance: " + String.format("%.2f", 250.0) = "Balance: 250.00".
Output:
Owner: Omar
Balance: 250.00
Projected Balance: 275.00

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