Test your basic knowledge |

C++ Programming Basics

Subject : it-skills
Instructions:
  • Answer 50 questions in 15 minutes.
  • If you are not ready to take this test, you can study here.
  • Match each statement with the correct term.
  • Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.

This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. For a local variable in a function to retain its value between calls to the function it must be declared with the ________ storage-class specifier.






2. If a member initializer is not provided for a member object of a class the object's __________ is called.






3. A recursive function typically has two components: One that provides a means for the recursion to terminate by testing for a(n) ________ case and one that expresses the problem as a recursive call for a slightly simpler problem than the original call






4. For every opening brace in a C++ program there must be a ______________.






5. The new operator dynamically allocates memory for an object of a specified type and returns a __________ to that type.






6. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.






7. Operator with only one operand






8. A ________ program executes before the compiler's translation phase begins.






9. Compares two strings and returns 0 if they are equal.






10. A constant object must be __________; it cannot be modified after it is created.






11. Lists and tables of values can be stored in arrays or __________.






12. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.






13. This manipulator causes the field to be left-justified with padding spaces printed to the right.






14. Causes the program exits the loop - skipping over the rest of the commands and starts executing again with the next thing outside the loop.






15. The process of placing the elements of an array in order is called ________ the array.






16. Forces the computer to display decimal point and trailing zeroes






17. The stream extraction operator






18. A memory location with a name and data type - its content may be changed during program execution






19. Class members specified as _________ are accessible only to member functions of the class and friends of the class.






20. C++ programs are normally typed into a computer using a(n) ________ program.






21. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.






22. Preprocessor directive syntax






23. Member objects are constructed __________ their enclosing class object.






24. A variable that is known only within the function in which it is defined is called a ________.






25. A C++ statement that makes a decision is ______.






26. = & | are examples of ____________.






27. All C++ Variables are_________.






28. A function is invoked with a ________.






29. Sets floating-point values to a fixed decimal format






30. The ________ enables access to a global variable with the same name as a variable in the current scope.






31. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.






32. A pointer is a variable that contains as its value the____________ of another variable.






33. The sign you use for pointers






34. Single letters or digits or special symbols; enclose value in single quotes ('a' '?' '8')






35. __________ can be used to assign an object of a class to another object of the same class.






36. Used to qualify hidden names so that they can be used.






37. The ________ statement in a called function passes the value of an expression back to the calling function.






38. Objects have the property of ________although objects may know how to communicate with one another across well-defined interfaces - they normally are not allowed to know how other objects are implemented.






39. The number used to refer to a particular element of an array is called its ________.






40. A __________ data member represents class-wide information.






41. You must have a ___________ for every variable you intend to use in a program






42. An operator that can only be used with int values. result will always be an int.






43. Words that are used for special purposes in a program






44. A function that can be used to read character data including whitespace






45. Storage-class specifier ________ is a recommendation to the compiler to store a variable in one of the computer's registers.






46. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors






47. A set of values together with a set of operations






48. Class members specified as _________ are accessible anywhere an object of the class is in scope.






49. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________






50. A variable declared outside any block or function is a ________ variable.