/
Vickie
/
hw_book
Обзор
Документация
Войти
/
Vickie
/
hw_book
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Book.java
36 строк
908 B
Vickie
Update: Book.java (public boolean isBig)
24 июн 2026, 12:34
Верифицирован
24 июн 2026, 12:34
45e2bfa
Код
Авторство
О чём код?
public class Book { public String title; public int releaseYear; Author author; public 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) { if (title.contains(word) || author.name.contains(word) || author.surname.contains(word)) { return true; } else { return false; } } public int estimatePrice() { int estimatedPrice = (int) Math.floor(3 * pages * Math.sqrt(author.rating)); if (estimatedPrice >= 250) { return (estimatedPrice); } else { return (250); } } }