/
OisNol
/
ClassStructure
Обзор
Документация
Войти
/
OisNol
/
ClassStructure
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Book.java
44 строки
1 KB
OisNol
Compiled files
25 фев 2025, 22:15
25 фев 2025, 22:15
6506a0d
Код
Авторство
О чём код?
public class Book { public String title; public int releaseYear; public int pages; public String author; public String toString(){ return "'" + author + "'" + "<<" + title + ">>," + releaseYear + "," + pages; } public Book(String title, int releaseYear, int pages, String author){ this.title = title; this.releaseYear = releaseYear; this.pages = pages; this.author = author; } public boolean isBig(){ if (pages > 500){ return true; } else { return false; } } public boolean matches(String word){ boolean result = word.contains(title); boolean result2 = word.contains(author); if ((result == true) || (result2 == true)){ return true; }else { return false; } } public int estimatePrice(){ int result = pages * 3; if (result < 250){ return 250; } else{ return result; } } }