Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project files #26

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add Rent class
seyedkosarmousavi committed May 16, 2024
commit 1c467a3a530b8c213e0c37d6f3b3c478a448dafb
32 changes: 32 additions & 0 deletions Answers/java project/Rent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import java.util.Date;

public class Rent {
private static int idCounter = 1;
private int rentalID;
private Book book;
private NormalUser user;
private Date rentalDate;

public Rent(Book book, NormalUser user) {
this.rentalID = idCounter++;
this.book = book;
this.user = user;
this.rentalDate = new Date();
}

public int getRentalID() {
return rentalID;
}

public Book getBook() {
return book;
}

public NormalUser getUser() {
return user;
}

public Date getRentalDate() {
return rentalDate;
}
}