/
PolinaMakhrova
/
Class4
Обзор
Документация
Войти
/
PolinaMakhrova
/
Class4
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Book.java
45 строк
1 KB
PolinaMakhrova
upload files
12 фев 2025, 23:16
12 фев 2025, 23:16
eee745c
Код
Авторство
О чём код?
public class Book { public String title; public int releaseYear; public int pages; public String authorNameCheck; public String authorSurnameCheck; public Author1 author6; public Book(String title, int releaseYear, int pages) { author6 = new Author1("Иван", "Иванов", 4); this.title = title; this.releaseYear = releaseYear; this.pages = pages; } public boolean isBig() { if (pages > 500) { return true; } else { return false; } } public boolean matches() { if (author6.name.contains(authorNameCheck) && author6.surname.contains(authorSurnameCheck)) { return true; } else { return false; } } public int estimatePrice() { int prise = (int) Math.floor(pages * 3 * Math.sqrt(author6.rating)); if (prise > 250) { return prise; } else { return 250; } } }