/
conann
/
test5
Обзор
Документация
Войти
/
conann
/
test5
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Book.java
32 строки
728 B
Kirill Opra
test 5
27 фев 2025, 15:36
27 фев 2025, 15:36
bbe5697
Код
Авторство
О чём код?
public class Book { Author author; String title; int releaseYear; int pages; public Book (Author author, String title, int releaseYear, 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 author.name.contains(word) || author.surname.contains(word) || title.contains(word); } public int estimatePrice() { int price = (int) (3 * pages * Math.sqrt(author.rating)); return Math.max(price, 250); } }