/
PolinaMakhrova
/
Class6
Обзор
Документация
Войти
/
PolinaMakhrova
/
Class6
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Book.java
43 строки
958 B
PolinaMakhrova
update Book.java
13 фев 2025, 20:36
13 фев 2025, 20:36
49cc80a
Код
Авторство
О чём код?
public class Book { public String title; public int releaseYear; public int pages; public String word; public Author1 author; public Book(String title, int releaseYear, int pages, Author1 author) { this.title = title; this.releaseYear = releaseYear; this.pages = pages; this.author = author; } public boolean isBig() { if (pages > 500) { return true; } return false; } public boolean matches() { if (author.name.contains(word) || author.surname.contains(word)) { return true; } else { return false; } } public int estimatePrice() { int prise = (int) Math.floor(pages * 3 * Math.sqrt(author.rating)); if (prise > 250) { return prise; } else { return 250; } } }