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