Can You Pass This C++ Programming Test? Quiz

10 Questions | Total Attempts: 940

SettingsSettingsSettings
Please wait...
Can You Pass This C++ Programming Test? Quiz

C++ is a high-level language that programmers need to have some necessary information on. We got to discuss how to use it to achieve the right functions of the central processing unit. This quiz contains 10 questions that pertain to the material you learned in Chapter 1. Give it a try and get to see how much you recall. All the best!


Questions and Answers
  • 1. 
    Given the enumeration defined by the following line, what is the value of UNBEATABLE ? enum difficulty {NOVICE=1, EASY, NORMAL, HARD, UNBEATABLE};
    • A. 

      1

    • B. 

      2

    • C. 

      3

    • D. 

      4

    • E. 

      5

  • 2. 
    What is the value of lives and bonus after the following code is run... int lives = 3; int bonus = 0; bonus = lives++ * 10;
    • A. 

      Lives = 4 and bonus = 30

    • B. 

      Lives = 3 and bonus = 30

    • C. 

      Lives = 3 and bonus = 40

    • D. 

      Lives = 4 and bonus = 40

  • 3. 
    Name one reason that game programmers choose C++. Use a one word answer.
  • 4. 
    What must statements in C++ end with?
  • 5. 
    All C++ programs must have at least one function called main()?
    • A. 

      True

    • B. 

      False

  • 6. 
    C++ is the most prevalent language in the computer game industry.
    • A. 

      True

    • B. 

      False

  • 7. 
    Dividing two integers (7/3) can sometimes yield a decimal point number.
    • A. 

      True

    • B. 

      False

  • 8. 
    Variable names of constants must be in uppercase letters according to C++ rules?
    • A. 

      True

    • B. 

      False

  • 9. 
    When you declare a variable, you must give it a type.
    • A. 

      True

    • B. 

      False

  • 10. 
    You must always assign a value to a variable when you first declare it.
    • A. 

      True

    • B. 

      False