សំណួរ
១. តើក្បួនមានសារសំខាន់យ៉ាងណាដែរ?
២. អ្វីទៅជាដំណឹង? អ្វីទៅជាដំណាង?
៣. អ្វីទៅជាកំរង arguments នៅក្នុងក្បួន?
៤. តើការស្វែងរកវត្ថុនៅក្នុងក្បួនប្រព្រឹត្តទៅដូចម្តេច?
លំហាត់អនុវត្តន៍
- Write a function that takes 2 numbers and returns -1 if the first is less than the second, 1 if the first is greater than the second, and 0 if the numbers are equal.
- Write a function that takes the length and width of a rectangle and calculates its area. If 1 parameter is passed to the function, then it calculates the square area.
- Write a function that takes time (hours, minutes, seconds) and displays it on the screen in the format "hh:mm:ss". If minutes and/or seconds were not sent when the function was called, then output them as 00.
- Write a function that takes hours, minutes, and seconds and returns this time in seconds.
- Write a function that takes the number of seconds, converts them into hours, minutes, and seconds and returns them as a string "hh:mm:ss".
- Write a function that takes 2 numbers and returns the smaller of them.
- Write a function that takes 2 numbers and a sign (+ - * /), calculates it, and returns the result.
- Write a function that takes a number and displays a multiplication table for this number. Call the function for all numbers from 2 to 9.
- Write a function that takes a date (day, month, year) and returns the date of the next day as a string "dd.mm.yyyy".
- Write a function that takes three separate digits and turns them into one number. For example: the digits 1, 4, 9 will become the number 149
- Write a function that takes numbers from 1 to 5 and returns their sum.
- Write a function that takes numbers from 1 to 5 and returns the larger of them.
- Write a function that calculates the difference between dates. The function takes 6 parameters, which describe 2 dates, and returns the result as a string "hh:mm:ss". When completing the task, use the functions from the previous 2 tasks: first convert both dates into seconds, find the difference in seconds, and then convert the difference back to "hh:mm:ss".
- Write a function that prints the number passed to it backwards. For example: print out the number 1234 as 4321.
- Write a function that calculates the sum of digits of a number. For example: the number is 1357, the sum is 1 + 3 + 5 + 7 = 16.