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. Meaning of the instructions in the language; compiler cannot find these errors - often called logic errors






2. The _________ begins the body of every function and the _________ ends the body of every function.






3. Syntax for named constant declaration






4. Preprocessor directive syntax






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






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






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






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






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






10. Naming convention for C++ programs






11. int namespace include using return examples of ___________






12. A function ________ enables a single function to be defined to perform a task on many different data types.






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






14. A __________ should be used to declare the size of an array because it makes the program more scalable.






15. The sign you use for references






16. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.






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






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






19. A function that calls itself either directly or indirectly - through another function) - is a ________ function.






20. These are data items whose values do not change while the program is running






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






22. Whole numbers - no decimals and no commas included






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






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






25. = & | are examples of ____________.






26. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.






27. Executable version of program






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






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






30. When you create a ___________________in the base class and then call it using an object the function will know to look in the inherited class for the specifics of that function.






31. The escape sequence ___ when output with cout and the stream insertion operator - causes the cursor to position to the beginning of the next line on the screen.






32. 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.






33. A function that calls itself






34. To write data to a file you define an object of which one of the following






35. The process of analyzing and designing a system from an object-oriented point of view is called ________.






36. A variable that holds the address of another variable.






37. When a value of one data type is implicitly (automatically) changed to another data type






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






39. The address-of operator. it is used to assign pointers and to print the address of variables.






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






41. A file must be ________ before data can be written to or read from it.






42. Keyword public is a(n) _________






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






44. OOD also takes advantage of ________ relationships where new classes of objects are derived by absorbing characteristics of existing classes - then adding unique characteristics of their own.






45. Repeating a set of instructions a specific number of times is called_________repetition.






46. The only integer that can be assigned directly to a pointer is_____________.






47. Classes can have relationships with other classes. These relationships are called ________.






48. Initializers __________ must be used to initialize constant members of a class.






49. The modulus operator (%) can be used only with __________.






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