Загрузка страницы

Javascript - Քննություն (variables, conditionals, boolean logic, loops, functions)

Քննություն
------------------

1. Ի՞նչ է Javascript-ը։

2. Ի՞նչ է փոփոխականը։ Գրեք փոփոխական ստեղծելու օրինակ։

3. Ի՞նչ արժեքներ ենք մենք սովորել։

4. Ի՞նչ է փոփոխականի արժեքը մինչ նրան ինչ-որ արժեք վերագրելը։

5. Համեմատման ի՞նչ օպերատորներ ենք անցել։

6. Ի՞նչ է ֆունկցիան։ Գրեք ֆունկցիա օգտագործելու օրինակ։

7. Մաթեմատիկական ի՞նչ օպերատորներ մենք գիտենք։

8. Ինչպե՞ս կարող ենք միացնել տեքստերը (strings):

9. Ինչպե՞ս կարող ենք վերածել տեքստը թվի և թիվը տեքստի։ (string to number and number to string)

10. Ի՞նչ բուլյան օպերատորներ մենք գիտենք։

11. Ինչպե՞ս են աշխատում if/if else/else։ Գրեք օրինակ։

12. Ինչպե՞ս կարող ենք ցիկլ ստեղծել մեր կոդում։ Գրեք օրինակ։

13. Ինչպե՞ս ենք մենք ստեղծում, կարդում, փոփոխում զանգվածի երկարությունը։ Գրեք օրինակ։

14. Ի՞նչ է բազմաչափ զանգվածը։ Գրեք օրինակ։

15. Գրեք ծրագիր, որը կհարցնի user-ից նրա տարիքը։ Եթե տարիքը փոքր է 10-ից, ցույց տվեք “hi” տեքստով պատուհան(alert)։ Եթե տարիքը մեծ է կամ հավասար 10, բայց փոքր է 18-ից, ցույց տվեք “hello” տեքստով պատուհան։ Մնացած բոլոր դեպքերում ցույց տվեք “greetings” տեքստով պատուհան

16. Գրեք ծրագիր, որը user-ից կշարունակի խնդրել թիվ մուտքագրել։ Երբ user-ը մուտքագրի “exit”, ցույց տվեք պատուհան (alert), որը կտպի մինչև այդ գրված բոլոր թվերի գումարը և կավարտի ծրագիրը։

17. Գրեք computeTriangleArea անունով ֆունկցիա, որը կվերցնի եռանկյան հիմքը և բարձրությունը և կվերադարձնի եռանկյան մակերեսը։ Օրինակ computeTriangleArea(2, 9)․ պետք է վերադարձի 9 որպես արդյունք։

18. Գրեք reverse անունով ֆունկցիա, որը կվերցնի զանգված և կվերադարձնի մի նոր զանգված, որի արժեքները նույնն են ինչ առաջին զանգվածինը, բայց համակարգված են հակառակ դասավորությամբ։ Օրինակ reverse([1, 2, 3, 4])․ պետք է վերադարձնի նոր զանգված նման արժեքներով՝ [4, 3, 2, 1]

19. Գրեք average անունով ֆունկցիա, որը կվերցնի թվերի զանգված, և կվերադարձնի այդ թվերի հանրահաշվական միջինը։ Օրինակ average([4, 3, 6, 10, 2])․ պետք է վերադարձի 5։

20. Գրեք factorial անունով ֆունկցիա, որը կվերցնի թիվ և կվերադարձնի այդ թվի ֆակտորիալը։ Հիշեք, որ թվի ֆակտորիալը, տրված թվից մինչև 1 բոլոր բնական թվերի արտադրյալն է։ Օրինակ factorial(5)․ պետք է վերադարձի 120։
Exam
---------

1. What is Javascript?

2. What is a variable? Provide an example of how to create it?

3. What values have we learned?

4. What is the value of a variable before it has been assigned a value?

5. What comparison operators have we learned?

6. What are functions? Provide examples of how to use them.

7. What math operators do we know?

8. How can we concatenate strings?

9. How can we convert from string to number and number to string?

10. What boolean operators do we know?

11. How does if/if else/else work? Please provide an example.

12. How can we create a loop in our code? Please provide an example.

13. How do we create, read, edit and know the length of an array? Please provide an example.

14. What is a multidimensional array? Please provide an example.

15. Write a program that prompts a user for their age. If the submitted age is less than 10, show an alert “hi”. If the age is greater than or equal to 10 but less than 18, alert “hello”. In all other cases, alert “greetings”.

16. Write a program that keeps asking the user for a number. When the user writes exit, show an alert that has the sum of all previously typed numbers in it and end the program.

17. Write a function called computeTriangleArea that takes the base and height of a triangle and returns the computed area of the triangle. Example: computeTriangleArea(2, 9); should return 9 as the result.

18. Write a function called reverse that takes an array and returns a new array that has the same values as the original array but sorted in the reverse order. Example: reverse([1, 2, 3, 4]); should return an array like this: [4, 3, 2, 1]

19. Write a function called average which, given an array of numbers, returns the average (or mean) of these numbers. Example: average([4, 3, 6, 10, 2]); should return 5

20. Write a function called factorial that takes a number and returns the factorial of that number. Remember, factorial says to multiply all whole numbers from our chosen number down to 1. Example: factorial(5) should return 120

Հղումներ
----------------

Javascript դասընթաց: https://youtube.com/playlist?list=PLkVo56yGU5Pqld7f3jtoE-g_755aPT0NV

Ֆեյսբուքյան էջ: https://www.facebook.com/roubenmeschian

Ֆեյսբուքյան խումբ: https://www.facebook.com/groups/1647352038759065

Կոդերի խմբագիր: https://roubenmeschian.com/editor/

Видео Javascript - Քննություն (variables, conditionals, boolean logic, loops, functions) канала meschian
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
24 ноября 2020 г. 0:13:30
00:35:04
Яндекс.Метрика