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. __________ can be used to assign an object of a class to another object of the same class.






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






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






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






5. Every C++ program begins execution at the function _________.






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






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






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






9. The _____ causes the contents of another file to be inserted into a program.






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






11. An expression that has operands with different data types






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






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






14. Use 2 characters to represent one






15. The ________ of an identifier is the portion of the program in which the identifier can be used.






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






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






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






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






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






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






22. A human readable file that contains C++ program






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






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






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






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






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






28. int namespace include using return examples of ___________






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






30. data types that refer to numbers with decimals






31. Keyword public is a(n) _________






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






33. A filestream variable that represents the default output device






34. Most calculations are normally performed by ______ statements.






35. Whole numbers - no decimals and no commas included






36. Function _________ from the <string> library reads characters until a newline character is encountered - then copies those characters into the specified string.






37. The storage-class specifiers are mutable - auto - ________ - extern and static.






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






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






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






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






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






43. Smallest individual unit of a programming language - special symbols or word symbols or identifiers






44. The escape sequence n represents the _________ character which causes the cursor to position to the beginning of the next line on the screen.






45. A member function should be declared static if it does not access __________ class members.






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






47. The sign you use for pointers






48. The conditional operator. it evaluates a line of code and returns one thing if the condition is true and a different thing if the condition is false.






49. Program components in C++ are called functions and ________.






50. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.