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 variable that is known only within the function in which it is defined is called a ________.






2. The three ways to return control from a called function to a caller are ________ - return expression and encounter.






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






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






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






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






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






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






9. The ________ program transfers the executable image of a C++ program from disk to memory.






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






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






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






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






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






15. A type of pointer that can point at objects of any data type.






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






17. The elements of an array are related by the fact that they have the same name and ___________.






18. A________ allows the compiler to check the number & types and order of the arguments passed to a function.






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






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






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






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






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






24. The symbol for the binary scope resolution operator






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






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






27. Whole numbers - no decimals and no commas included






28. Type casting syntax






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






30. To explicitly indicate that a value is to be converted to another type






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






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






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






34. An expression that has operands with different data types






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






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






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






38. Syntax for named constant declaration






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






40. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.






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






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






43. A filestream variable that represents the default output device






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






45. newline






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






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






48. Naming convention for C++ programs






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






50. The ________ qualifier is used to declare read-only variables.