/
JenRudson
/
book3
Обзор
Документация
Войти
/
JenRudson
/
book3
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/Book.java
27 строк
716 B
JenRudson
upload files
31 окт 2025, 17:57
31 окт 2025, 17:57
cdaeb27
Код
Авторство
О чём код?
public class Book { String title; int releaseYear; Author author; 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() { int price = 3 * pages; return Math.max((int) Math.floor(price * Math.sqrt(author.rating)), 250); } }