លំហាត់ក្នុងមេរៀន7.3 Bank Loan Interest Calculation
#រៀនសរសេរកូដជាមួយចិត្រា #javaprogramming #javabasics #codingwithchitra
ស៊ុនអ៊ូខុងបានឡើងទៅអុកឡុនឋានលើ ដើម្បីខ្ចីលុយពី ព្រះនាង គង់ស៊ីអ៊ីមចំនួន ៥ម៉ឺនដុល្លា ក្នុងអត្រាការប្រាក់ 12% ក្នុងមួយឆ្នាំ។ អ៊ូខុងបានតវ៉ាសុំខ្ចីប្រាក់ រំជួយដីរង្គើរមេឃ រហូតដល់ ព្រះនាងគង់ស៊ីអ៊ីមយល់ព្រមចុះកិច្ចសន្យាអោយខ្ចីប្រាក់ក្នុងរយះពេល ១៥ឆ្នាំ។
1. ផ្តល់តំលៃអោយអថេរ: Declare and initialize variables for loan amount, interest rate, and the number of years. Use appropriate double values.
2. គណនាអត្រាកាប្រាក់ប្រចាំខែ: Calculate the monthly interest rate by converting the annual interest rate to a decimal. The formula is:
monthlyInterestRate = annualInterestRate / 12 / 100;
3. តើអ៊ូខូងត្រូវបង់ការប្រាក់អស់ប៉ុន្មាន? Calculate the total interest accrued over the loan period using the formula:
totalInterest = loanAmount * monthlyInterestRate * numberOfMonths;
4. តើទាំងដើមទាំងកាប្រាក់ អ៊ូខុងត្រូវសងត្រឡប់ទៅវិញប៉ុន្មាន?
Calculate the total amount to be repaid, including the principal amount and total interest. The formula is:
totalRepayment = loanAmount + totalInterest;
5. បង្ហាញលទ្ធផល:
Print out the loan amount, annual interest rate, number of years, monthly interest rate, total interest, and total repayment amount.
ម្រងវីដេអូមេរៀន Python 👉 https://t.ly/AkY3Y
កម្រងវីដេអូមេរៀន java 👉 https://t.ly/WjMVf
YouTube Channel 👉 https://www.youtube.com/@codingwithchitra
Facebook Page 👉 https://www.facebook.com/khmshared
Telegram Channel 👉 https://t.me/codingwithchitra
——
#freecourses2024 #python #pythontutorial #free #computersciencestudent #codingwithchitra #coder #codechallenge #python3 #រៀនសរសេរកូដ #codingfromzerotohero #pythonprogramming #រៀនសរសេរកូដជាមួយចិត្រា #freecoursedaily #pythonbasics #CodingWithChitra #code #sololearncoding #pythonhub #pythonquiz #freecourse #pythonmemes #codinglife