Page 280 - CA_Blue( J )_Class10
P. 280
6 void input()
7 {
8 Scanner sc=new Scanner(System.in);
9 System.out.print("Enter the accession no.:");
10 acc_num=sc.nextInt();
11 System.out.print("Enter the title:");
12 title=sc.next();
13 System.out.print("Enter the author:");
14 author=sc.next();
15 }
16 int compute()
17 {
18 Scanner sc=new Scanner(System.in);
19 int late,fine;
20 System.out.print("Enter the no. of days late:");
21 late=sc.nextInt();
22 fine=late*2;
23 return fine;
24 }
25
26 void display()
27 {
28 int f=compute();
29 System.out.println("Accession_number"+"\t"+"Title"+"\t"+"Author"+"\
t"+"Fine");
30 System.out.println(acc_num+"\t"+title+"\t"+author+"\t"+f);
31 }
32
33 public static void main(String args[])
34 {
35 Library ob=new Library();
36 ob.input();
37 ob.display();
38 }
39 }
278278 Touchpad Computer Applications-X

