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

Wallet Balance Guard

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create Main.java and WalletGuard.java.

Implement the class using private fields plus getters and setters.

Use the object to print the required report exactly as described.

Input Format

Input is given as whitespace-separated tokens in the order stated in the question.

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
50.0
Owner: Lina
Balance: 50.00
Input: owner = "Lina", balance = 50.0.
Key calculation(s): "Owner: " + "Lina" = "Owner: Lina" | "Balance: " + String.format("%.2f", 50.0) = "Balance: 50.00".
Output:
Owner: Lina
Balance: 50.00
Sample #2
Public sample
Omar
10.5
Owner: Omar
Balance: 10.50
Input: owner = "Omar", balance = 10.5.
Key calculation(s): "Owner: " + "Omar" = "Owner: Omar" | "Balance: " + String.format("%.2f", 10.5) = "Balance: 10.50".
Output:
Owner: Omar
Balance: 10.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