/
Shcod
/
java-hw-class_struct
Обзор
Документация
Войти
/
Shcod
/
java-hw-class_struct
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/main/java/Book.java
25 строк
675 B
Shcod
firs commit
27 июл 2026, 09:19
27 июл 2026, 09:19
ce82373
Код
Авторство
О чём код?
public class Book { private String title; private int releaseYear; private Author author; private int pages; public Book(String title, int releaseYear, Author author, int pages) { this.title = title; this.releaseYear = releaseYear; this.author = author; this.pages = pages; } public boolean isBig() { return pages > 500; } public boolean matches(String word){ return title.contains(word) || author.name.contains(word) || author.surname.contains(word); } public int estimatePrice() { return Math.max((int) Math.floor(3.0 * pages * Math.sqrt(author.rating)), 250); } }