/
lebedev666
/
DZ-5
Обзор
Документация
Войти
/
lebedev666
/
DZ-5
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Book.java
41 строка
1014 B
lebedev666
Update: Book.java
09 июл 2026, 13:16
Верифицирован
09 июл 2026, 13:16
a619286
Код
Авторство
О чём код?
public class Book { public String title; public String releaseYear; public Author author; public int pages; public Book(String title, String 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 (author.name.contains(word)) { return true; } else if (author.surname.contains(word)) { return true; } else { return false; } } public int estimatePrice() { int resul1 = pages * 3; double resul2 = Math.sqrt(author.rating); double price = resul1 * resul2; if (price < 250) { return 250; } else { return (int) Math.floor(price); } } }