/
Arsalan
/
StructureClasses
Обзор
Документация
Войти
/
Arsalan
/
StructureClasses
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Book.java
37 строк
956 B
Arsalan
upload files
31 июл 2025, 14:28
31 июл 2025, 14:28
aca3d20
Код
Авторство
О чём код?
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() { if (pages > 500) { return true; } else { return false; } } 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(){ if ((int) Math.floor(Math.sqrt(author.rating)) * 3 > 250 ){ return (int) Math.floor(Math.sqrt(author.rating))*3; } else { return 250; } } }