-
Notifications
You must be signed in to change notification settings - Fork 102
Решение lesson1 task1 #105
Conversation
maven[INFO] Scanning for projects... |
Ваша программа не компилируется. Решив какие-либо задания, обязательно проверяйте их на тестовых функциях -- так, как написано здесь: https://github.com/Kotlin-Polytech/KotlinAsFirst2016/blob/master/tutorial/chapter01.adoc#Упражнения |
src/lesson1/task1/Simple.kt
Outdated
* Например, 100 рублей под 10% годовых превратятся в 133.1 рубля | ||
*/ | ||
fun accountInThreeYears(initial: Int, percent: Int): Double = TODO() | ||
fun accountInThreeYears(initial: Int, percent: Int): Double = (initial*pow(percent,3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Оба аргумента функции pow должны иметь тип Double. У вас они имеют тип Int. Кроме этого, формула в принципе неверна. Например, для суммы в 100 рублей под 2% годовых вы получите с её помощью итог 800 рублей.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Понятно, Спасибо большое
src/lesson1/task1/Simple.kt
Outdated
*Необходимо вывести число, полученное из заданного перестановкой цифр в обратном порядке (например, 874). | ||
*/ | ||
fun numberRevert(number: Int): Int = TODO() | ||
fun numberRevert(number: Int): Int = (numbers/100+number/10%10+number%10*100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Имя numbers
не определено
Вы до сих пор не прислали мне письмо с вашим настоящим именем, фамилией, номером группы и логином на GitHub. Пожалуйста, сделайте это, мой e-mail glukhikh@mail.ru |
authorhehe134 [624623296@qq.com] lesson1.task1Author: hehe134 [624623296@qq.com] Owner: hehe134 [624623296@qq.com] Total: 10 / 12 Example: 4 / 4 Succeeded:
Failed:
Seed: 1823990364213401937 ownerhehe134 [624623296@qq.com] |
Поищите ошибки в travelMinutes и numberRevert. В отчёте бота выше содержатся примеры, на которых ваша функция работает неправильно (к примеру, переворачивая число 947, вы получаете результат 713 вместо 749). |
src/lesson1/task1/Simple.kt
Outdated
* Вывести значение того же угла в радианах (например, 0.63256). | ||
*/ | ||
fun angleInRadian(grad: Int, min: Int, sec: Int): Double = TODO() | ||
fun angleInRadian(grad: Int, min: Int, sec: Int): Double =(grad/180.0*PI+min/60.0/180*PI+sec/3600.0/180*PI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Старайтесь ставить больше пробелов, такая строка плохо читается. Используйте Ctrl+Alt+L для автоматического форматирования кода в IDEA.
authorhehe134 [624623296@qq.com] lesson1.task1Author: hehe134 [624623296@qq.com] Owner: hehe134 [624623296@qq.com] Total: 12 / 12 Example: 4 / 4 Succeeded:
Seed: -4230738481497432600 ownerhehe134 [624623296@qq.com] |
Сейчас всё решено верно. |
No description provided.