/
msigin77
/
Home_work5
Обзор
Документация
Войти
/
msigin77
/
Home_work5
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Book.java
30 строк
906 B
msigin77
Д\з№6
08 ноя 2025, 12:25
08 ноя 2025, 12:25
dcf19d2
Код
Авторство
О чём код?
public class Book { public String title; //- название книги; public int releaseYear; // - год выпуска; public Author author; //- автор; public int 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 = pages*3 * (int) Math.floor(Math.sqrt(author.rating)); if (price<250) { return 250; } else { return price; } } public Book(String title, int releaseYear, Author author, int pages) { this.title = title; this.releaseYear = releaseYear; this.author = author; this.pages = pages; } }