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

Login Attempt Counter

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create Main.java and LoginAttempt.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
1
User: lina
Attempts: 1
Objects: 1
Input: username = "lina", attempts = 1.
Key calculation(s): "User: " + "lina" = "User: lina" | "Attempts: " + 1 = "Attempts: 1".
Output:
User: lina
Attempts: 1
Objects: 1
Sample #2
Public sample
omar
3
User: omar
Attempts: 3
Objects: 1
Input: username = "omar", attempts = 3.
Key calculation(s): "User: " + "omar" = "User: omar" | "Attempts: " + 3 = "Attempts: 3".
Output:
User: omar
Attempts: 3
Objects: 1

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