-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary.java
More file actions
38 lines (38 loc) · 916 Bytes
/
Copy pathLibrary.java
File metadata and controls
38 lines (38 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.*;
class Library
{
int acc_num;
String title;
String author;
Scanner sc=new Scanner(System.in);
void input()
{
System.out.print("Enter Accession Number: ");
acc_num=sc.nextInt();
System.out.print("Enter Title of Book: ");
sc.next();
title=sc.next();
System.out.print("Enter Author name: ");
author=sc.next();
}
void compute()
{
int n,fine;
System.out.print("Enter Late days: ");
n=sc.nextInt();
fine=n*2;
System.out.println("Fine :"+fine);
}
void display()
{
System.out.println("Accession Number\t"+"Title\t"+"Author\t");
System.out.println(acc_num+"\t"+title+"\t"+author+"\t");
}
public static void main(String args[])
{
Library ob=new Library();
ob.input();
ob.compute();
ob.display();
}
}