១. តើយុទ្ធសាស្ត្រនៃការសរសេរកម្មវិធីកំព្យូទ័រតាមរបៀប PP (Prcedural Programming) និងតាមរបៀប OOP (Object Oriented Programming) ខុសគ្នាដូចម្តេចដែរ?
២. តើការបង្កើតថ្នាក់មានប្រយោជន៍អ្វីខ្លះនៅក្នុងការសរសេរកម្មវិធីកំព្យូទ័រ?
៣. តើក្បួននិងវិធីខុសគ្នាដូចម្តេចដែរ?
៤. តើធ្វើដូចម្តេចទើបអាចយកវិធីទាំងឡាយនៅក្នុងថ្នាក់ណាមួយមកប្រើបាន?
៥. តើពាក្យថា «this» នៅក្នុងវិធីទាំងឡាយគឺជាអ្វីដែរ?
៦. អ្វីទៅជាទិន្នន័យសិស្ស?
៧. នៅពេលដែលយើងយកវិធីឬទិន្នន័យណាមួយមកប្រើតាមរយៈសិស្សណាមួយ តើការស្វែងរកវត្ថុឬអថេរនោះត្រូវធ្វើឡើងយ៉ាងដូចម្តេច?
Task 1
Implement a class that describes a circle. The class should have the following components:
- field storing radius of the circle;
- get property that returns radius of the circle;
- set property that sets radius of the circle;
- get property that returns diameter of the circle;
- method that calculates area of the circle;
- method that calculates perimeter of the circle.
Demonstrate the work of properties and methods.
Task 2Implement a class that describes the news (title, text, tag array, publication date). In the class, implement one print method that outputs all the information as follows:
Notice how date is displayed:- if less than a day has passed since the publication date, then "today" is output;
- if less than a week has passed since the publication date, then "N days ago"
- in other cases, full date is output as follows: "dd.mm.yyyy"
ក្នុងការយកអក្សរខ្មែរពីប្រព័ន្ធ Google Fonts មកប្រើប្រាស់នៅលើគេហទំព័រណាមួយ យើងត្រូវសរសេរកូដ HTML ដូចខាងក្រោមនេះ៖
<!DOCTYPE html> <html> <head> <link href='https://fonts.googleapis.com/css?family=Odor+Mean+Chey' rel='stylesheet'> </head> <body style="font:14px/1.5 'Odor Mean Chey'"> <p>កម្មវិធីកាលបរិច្ឆេទ និង នាឡិកា Digital ជាភាសាខ្មែរ</p> </body> </html>
នៅលើទំព័រ HTML ខាងលើនេះ យើងចាំបាច់ត្រូវបង្កើតនិងបង្ហាញកាលបរិច្ឆេទនៅពេលបច្ចុប្បន្ន និងនាឡិកា digital មួយជាភាសាខ្មែរ ដោយបង្កើតថ្នាក់មួយដែលនៅក្នុងនោះ ត្រូវមានទិន្នន័យនិងវិធី ចាំបាច់ទាំងឡាយសំរាប់បង្ហាញនូវកាលបរិច្ឆេទ និងនាឡិកា digital ជាភាសាខ្មែរ ដូចនៅលើក្បាលនៃគេហទំព័រខាងក្រោមនេះ៖
https://khtv.herokuapp.com/