/
JenRudson
/
book2
Обзор
Документация
Войти
/
JenRudson
/
book2
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/Book.java
25 строк
688 B
JenRudson
upload files
31 окт 2025, 15:46
31 окт 2025, 15:46
3884795
Код
Авторство
О чём код?
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 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); } }