Programming with JavaScript Questions And Answers | Latest Update | 2024/2025 | Already Passed
Programming with JavaScript Questions And Answers | Latest Update | 2024/2025 | Already Passed 1. What function should you use to print to the screen? println 2. Which keyword is used to declare a variable in JavaScript? var 3. In the code segment: ``` a — 10 b — 5 c — a+b ``` What value is stored in variable c? 15 4. Consider the code: ``` a — 1 b — a a — 2 ``` What value is stored in variable b? 1 5. Which function do you call to prompt the user to enter text? readLine 6. Which function do you use to ask the user for a number in JavaScript? Both readInt and readFloat are for numbers. 7. Consider the code: ``` DISPLAY ("What is your name?") name — INPUT() DISPLAY ("Hello") DISPLAY (name) ``` If the user inputs "Karel", what is displayed? What is your name? Karel Hello Karel 8. What will be displayed after running the following code? ``` a — "Welcome!" DISPLAY (a) b — "¡Hola!" DISPLAY (b) a — b b — "Bonjour!" DISPLAY (a) DISPLAY (b) ``` Welcome! ¡Hola! ¡Hola! Bonjour! 9. If the user inputs "P", what is displayed? ``` DISPLAY ("Enter a character.") symbol — INPUT () DISPLAY (":") DISPLAY ("c") DISPLAY (symbol) ``` Enter a character. : c P 10. What will the following code print to the screen? ``` println(2+2); ``` 4 11. What symbol is used for division in JavaScript? /
Written for
- Institution
- Programming with JavaScript
- Course
- Programming with JavaScript
Document information
- Uploaded on
- June 20, 2024
- Number of pages
- 7
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
programming with javascript questions and answers
Also available in package deal