0% found this document useful (0 votes)
2 views1 page

Member Java

The document contains a Java class named 'Member' designed for a simplified GUI exercise. It includes methods for displaying member information, borrowing items, and returning items, with a borrowing limit of three books. The class maintains member details such as name, ID, and the count of borrowed books.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Member Java

The document contains a Java class named 'Member' designed for a simplified GUI exercise. It includes methods for displaying member information, borrowing items, and returning items, with a borrowing limit of three books. The class maintains member details such as name, ID, and the count of borrowed books.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2/17/26, 3:55 PM magazineJava

magazineJava

1 /**
2 * LAB 8: GUI with Swing - STUDENT EXERCISE
3 *
4 * TODO: Students complete this simplified GUI
5 *
6 */
7
8 public class Member {
9 public String name;
10 public int id;
11 public int borrowedBookCount;
12
13 public static final int BORROW_LIMIT = 3;
14
15 Member(String name, int id){
16 [Link] = name;
17 [Link] = id;
18 [Link] = 0;
19 }
20
21 public void displayInfo(){
22 [Link]("Member: "+ [Link]+ " (ID: " + [Link] +") | Borrowed
Books: " + [Link]);
23 }
24
25
26 public String borrowItem(LibraryItem l){
27 if([Link]()){
28 [Link]++;
29 return [Link]+" successfully borrowed "+[Link]+"!";
30
31 }
32 else{
33 return [Link] + " Sorry Cannot borrow "+ [Link];
34 }
35 }
36
37 public String returnItem(LibraryItem i){
38 [Link]();
39 [Link]--;
40 return [Link]+" returned "+[Link]+"!";
41 }
42
43
44 }
45

[Link] 1/1

You might also like