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






2. Creates a copy of a string.






3. A filestream variable that represents the default input source






4. Symbol that denotes an action to be performed






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






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






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






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






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






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






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






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






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






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






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






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






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






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






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






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






21. Used for dynamically allocated variables






22. Lists and tables of values can be stored in arrays or __________.






23. Used for function calls and local variables






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






25. C++ programs are normally typed into a computer using a(n) ________ program.






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






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






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






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






30. Preprocessor directive syntax






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






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






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






34. Executable version of program






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






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






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






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






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






40. The stream extraction operator






41. An expression that has operands with different data types






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






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






44. A C++ statement that makes a decision is ______.






45. Use 2 characters to represent one






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






47. Message displayed to the screen asking user for input; generated with an output statement






48. Whole numbers - no decimals and no commas included






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






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