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

Bank Account Snapshot

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create two Java files: Main.java and BankSnapshot.java.

Read the required values, construct a BankSnapshot object, and print a multiline report.

The report must contain these lines in this order:

  1. Owner
  2. Final Balance
  3. State

Use a constructor and keep the object-oriented structure clear.

Input Format

Input is provided as separate whitespace-separated tokens in the same order described in the problem statement.

Output Format

Print the exact multiline report required by the question.

Sample Testcases

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

Sample #1
Public sample
Lina
100.0
30.0
20.0
Owner: Lina
Final Balance: 110.00
State: VALID
Input: owner name = "Lina", opening balance = 100.0, deposit amount = 30.0, withdrawal amount = 20.0.
Key calculation(s): "Owner: " + "Lina" = "Owner: Lina" | "Final Balance: " + String.format("%.2f", 100.0 + 30.0 - 20.0) = "Final Balance: 110.00".
Output:
Owner: Lina
Final Balance: 110.00
State: VALID
Sample #2
Public sample
Omar
50.0
10.0
80.0
Owner: Omar
Final Balance: -20.00
State: OVERDRAWN
Input: owner name = "Omar", opening balance = 50.0, deposit amount = 10.0, withdrawal amount = 80.0.
Key calculation(s): "Owner: " + "Omar" = "Owner: Omar" | "Final Balance: " + String.format("%.2f", 50.0 + 10.0 - 80.0) = "Final Balance: -20.00".
Output:
Owner: Omar
Final Balance: -20.00
State: OVERDRAWN

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