The arithmetic & Assignment Operators in Java Part 9.1 - JAVA ថ្នាក់ទី១ | JAVA For Beginner
#រៀនសរសេរកូដជាមួយចិត្រា #javaprogramming #javabasics #codingwithchitra #sololearncoding #corejava
The arithmetic & Assignment Operators in Java Part 9.1
9 Introduction to Operators in Java
Operators ត្រូវបានប្រើដើម្បីអនុវត្តប្រតិបត្តិការលើអញ្ញាត(Variables) និងតម្លៃរបស់វា(Values)។
នៅក្នុងភាសា Java Operators ត្រូវបានគេបែងចែកជាក្រុមដូចខាងក្រោម៖
- Assignment & Arithmetic Operators
- Unary Operators
- The Equality and Relational Operators
- The Conditional Operators
- Bitwise and Bit Shift Operators
ធ្វើច្រើនចេះច្រើន!
ខាងក្រោមនេះជាលំហាត់ អ្នកទាំងអស់គ្នាត្រូវចំណាយអោយពេលអោយច្រើន នៅជាមួយកូដ ទើបធ្វើអោយរីកចម្រើនទៅមុខ។ កុំពូកែរៀន តែពូកែធ្វើ!
Exercise: Arithmetic operators
1) Write a program that calculates the area and perimeter of a rectangle. The program should prompt the user to enter the length and width of the rectangle, and then display the calculated area and perimeter.
2) Write a program that converts temperature from Celsius to Fahrenheit. The program should prompt the user to enter a temperature in Celsius and then display the equivalent temperature in Fahrenheit. The conversion formula is: Fahrenheit = (Celsius × 9/5) + 32.
3) Write a program that calculates the average of three numbers. The program should prompt the user to enter three numbers, and then display the calculated average.
4) Write a program that swaps the values of two variables without using a temporary variable. The program should prompt the user to enter two numbers, swap their values, and then display the new values of the variables.
5. Write a program that calculates the compound interest. The program should prompt the user to enter the principal amount, interest rate, and the number of years, and then display the calculated compound interest. The formula for compound interest is: Compound Interest = P(1 + r/n)^(nt) - P, where P is the principal amount, r is the annual interest rate, n is the number of times interest is compounded per year, and t is the number of years.
កម្រងវីដេអូមេរៀន JAVA ថ្នាក់ទី១👉 https://youtube.com/playlist?list=PLSJTJj3gU6qhkjSEUmgBKGJnn0ob1NZSu&si=rcvL8CwF_5EGx_2n
កម្រងវីដេអូមេរៀន Python 👉 https://youtube.com/playlist?list=PLSJTJj3gU6qimVFO-iV1pOsxTujdIEAqo&si=EyC1cjq73QNGJYI_
YouTube Channel 👉 https://www.youtube.com/@codingwithchitra
Facebook Page 👉 https://www.facebook.com/khmshared
Telegram Channel 👉 https://t.me/codingwithchitra