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. A type of pointer that can point at objects of any data type.






2. In inheritance the ____________ is the class that supplies the inherited members.






3. Every C++ statement ends with a(n) _________.






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






5. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.






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






7. Characters used to separate symbols or reserved words or identifiers and statements






8. Class members are accessed via the ________ operator in conjunction with the name of an object (or reference to an object) of the class or via the arrow (->) operator in conjunction with a pointer to an object of the class.






9. The process of determining if an array contains a particular key value is called _________ the array.






10. A function is invoked with a ________.






11. Associate an identifier with a memory location






12. A sequence of operands and operators that describe a calculation to be performed






13. Function ________ is used to set the random number seed to randomize a program.






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






15. C++ programmers concentrate on creating ________ which contain data members and the member functions that manipulate those data members and provide services to clients.






16. directive A statement that starts with a # is called a ____________.






17. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.






18. An array that uses two subscripts is referred to as a(n) _________ array.






19. Operator with two operands






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






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






22. Nonexecutable statements that are included in a program to provide information about what the program does etc.






23. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .






24. An expression in which all operands have the same data type - result will have the same data type as operands






25. Creates a copy of a string.






26. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution






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






28. Default name of executable file






29. This manipulator is used to establish a field width for the value immediately following it.






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






31. Grammar rules of the language; compiler will try to identify and locate syntax errors






32. Keyword public is a(n) _________






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






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






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






36. In inheritance the ____________ is the class the receives the inherited members.






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






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






39. The symbol for the binary scope resolution operator






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






41. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.






42. Used for function calls and local variables






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






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






45. The idea that you can call the same function and the output will depend on the type of object you're using.






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






47. This is used to mark the end of a complete C++ programming statement.






48. Allows the programmer to store a value in a variable






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






50. Returns the length of a string excluding the null terminator.