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

Library Loan Ledger

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

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

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

The report must contain these lines in this order:

  1. Title
  2. Remaining Copies
  3. Fine

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
BK1
10
3
2
Title: BK1
Remaining Copies: 7
Fine: 3.00
Input: title code = "BK1", copies = 10, borrowed copies = 3, days late = 2.
Key calculation(s): "Title: " + "BK1" = "Title: BK1" | "Remaining Copies: " + 10 - 3 = "Remaining Copies: 7".
Output:
Title: BK1
Remaining Copies: 7
Fine: 3.00
Sample #2
Public sample
BK2
6
1
0
Title: BK2
Remaining Copies: 5
Fine: 0.00
Input: title code = "BK2", copies = 6, borrowed copies = 1, days late = 0.
Key calculation(s): "Title: " + "BK2" = "Title: BK2" | "Remaining Copies: " + 6 - 1 = "Remaining Copies: 5".
Output:
Title: BK2
Remaining Copies: 5
Fine: 0.00

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