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. Symbol that denotes an action to be performed






2. You can declare default values for a function in the ____________________.






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






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






5. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.






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






7. newline






8. Preprocessor directive syntax






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






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






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






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






13. Type casting syntax






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






15. A function that calls itself






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






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






18. To allow file access in a program you must #include this header file.






19. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.






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 sign you use for pointers






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






23. The size & shape & color and weight of an object are considered






24. Whole numbers - no decimals and no commas included






25. Syntax for named constant declaration






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






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






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






29. The symbol for the binary scope resolution operator






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






31. The three values that can be used to initialize a pointer are 0 - __________ and an address.






32. Default name of executable file






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






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






35. Syntax for reading char type variables by extracting one nonwhitespace character extracted at a time






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






37. Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.






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






39. All ______ must be declared before they are used.






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






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






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






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






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






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






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






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






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






49. Operator with only one operand






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