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

Digital Wallet Network

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create Main.java and DigitalWallet.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
W1
25.0
1.0
Wallet: W1
Spendable: 24.00
Input: wallet id = "W1", balance = 25.0, fee = 1.0.
Key calculation(s): "Wallet: " + getWalletId() = "Wallet: W1" | "Spendable: " + String.format("%.2f", 25.0 - 1.0) = "Spendable: 24.00".
Output:
Wallet: W1
Spendable: 24.00
Sample #2
Public sample
W2
100.0
2.5
Wallet: W2
Spendable: 97.50
Input: wallet id = "W2", balance = 100.0, fee = 2.5.
Key calculation(s): "Wallet: " + getWalletId() = "Wallet: W2" | "Spendable: " + String.format("%.2f", 100.0 - 2.5) = "Spendable: 97.50".
Output:
Wallet: W2
Spendable: 97.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