JavaScript Exam (java1-2)

18 Questions

Settings
Please wait...
JavaScript Quizzes & Trivia

Goes over material from Java1 to Java2 for Kristian Stout's exam.


Questions and Answers
  • 1. 
    What are the basic tags needed before adding anything about Javascript?
  • 2. 
    What is the tag necessary to begin Javascript?
  • 3. 
    How do you write a variable? Please use x as the variable name and 0 as its value.
  • 4. 
    Write the single line code that would alert me "Hello."
  • 5. 
    A string value is...
    • A. 

      A value that is all words

    • B. 

      A value that is either true or false

    • C. 

      A numerical value

  • 6. 
    A boolean value 
    • A. 

      A value that is either true or false

    • B. 

      A numerical value

    • C. 

      A value that is all words

  • 7. 
    Write the single line code that will display "print to screen, please."
  • 8. 
    Write the single line code that will ask me for my name.
  • 9. 
    Write the arithmetic operation symbols for addition, division, multiplication, and subtraction in that order using commas to separate them.
  • 10. 
    Javascript has an operator for exponents.
    • A. 

      True

    • B. 

      False

  • 11. 
    We call _______ operators those that operate on two values, i.e. a+b.
  • 12. 
    ________ operators operate on one value, i.e. a++
  • 13. 
    What are the increment and decrement symbols respectively? do not submit symbols. use words.
  • 14. 
    What are the logical symbols for AND, OR, and NOT? Separate them by commas.
  • 15. 
    Write a single line comment that reads "my comment."
  • 16. 
    Write a multi-line comment that reads "your comment."
  • 17. 
    Write an if-else snippet of code. if the variable red is true, alert "red is an awesome color." if false, display "why don't you get a red cup then?"
  • 18. 
    Write an if-else if snippet of code for the following: I can buy things called shirts or shoes. If i buy shirts, display "i love your shirt." if i buy shoes, alert me "just one pair?" if i don't buy anything, display "has the economy got you down?"