Bibliothek/Buch.java aktualisiert

This commit is contained in:
Denys Konovalov 2024-09-27 10:54:47 +02:00
parent 8bcc8e8a02
commit f8e091216c

@ -1,33 +1,33 @@
public class Buch {
private String title;
private String author;
public String ISBN;
private int count;
Buch(String newTitle, String newAuthor, String newISBN, int newCount) {
title = newTitle;
author = newAuthor;
ISBN = newISBN;
count = newCount;
}
public boolean ausleihen() {
if (count > 0) {
count--;
return true;
} else {
return false;
}
}
public void zurueckgeben() {
count++;
}
public void buchInfo() {
System.out.printf("Titel: %s\n", title);
System.out.printf("Autor: %s\n", author);
System.out.printf("ISBN: %s\n", ISBN);
System.out.printf("Verfügbar: %s\n", count);
}
}
public class Buch {
private String title;
private String author;
public String ISBN;
private int count;
Buch(String newTitle, String newAuthor, String newISBN, int newCount) {
title = newTitle;
author = newAuthor;
ISBN = newISBN;
count = newCount;
}
public boolean ausleihen() {
if (count > 0) {
count--;
return true;
} else {
return false;
}
}
public void zurueckgeben() {
count++;
}
public void buchInfo() {
System.out.printf("Titel: %s\n", title);
System.out.printf("Autor: %s\n", author);
System.out.printf("ISBN: %s\n", ISBN);
System.out.printf("Verfügbar: %s\n", count);
}
}