/
weazweazweaz
/
HW_Class_Intro
Обзор
Документация
Войти
/
weazweazweaz
/
HW_Class_Intro
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Book.java
26 строк
718 B
weazweazweaz
upload files
09 ноя 2025, 21:49
09 ноя 2025, 21:49
2e934ea
Код
Авторство
О чём код?
public class Book { public String title; public int releaseYear; public 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) { return title.contains(word) || author.name.contains(word) || author.surname.contains(word); } public int estimatePrice() { int price = (int) ((pages * 3) * Math.sqrt(author.rating)); return Math.max(price, 250); } }