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

Smart Building Access

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create Main.java and AccessBadge.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
B1
10
3
Badge: B1
Remaining Accesses: 7
Input: badge id = "B1", allowed doors = 10, used today = 3.
Key calculation(s): "Badge: " + getBadgeId() = "Badge: B1" | "Remaining Accesses: " + getAllowedDoors() - getUsedToday() = "Remaining Accesses: 7".
Output:
Badge: B1
Remaining Accesses: 7
Sample #2
Public sample
B2
5
5
Badge: B2
Remaining Accesses: 0
Input: badge id = "B2", allowed doors = 5, used today = 5.
Key calculation(s): "Badge: " + getBadgeId() = "Badge: B2" | "Remaining Accesses: " + getAllowedDoors() - getUsedToday() = "Remaining Accesses: 0".
Output:
Badge: B2
Remaining Accesses: 0

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