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. To allow file access in a program you must #include this header file.






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






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






4. The stream insertion operator






5. This manipulator causes the field to be left-justified with padding spaces printed to the right.






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






7. ________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.






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






9. Creates a copy of a string.






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






11. In inheritance the ____________ is the class that supplies the inherited members.






12. newline






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






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






15. Used to qualify hidden names so that they can be used.






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






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






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






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






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






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






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






23. Used for function calls and local variables






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






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






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






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






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






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






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






31. int namespace include using return examples of ___________






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






33. An expression that has operands with different data types






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






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






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






37. * / % + -






38. The ________ program combines the output of the compiler with various library functions to produce an executable image.






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






40. A function is invoked with a ________.






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






42. A program that finds and attaches to your program the indicated libraries for compilation






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






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






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






46. Most calculations are normally performed by ______ statements.






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






48. All programs can be written in terms of three types of control structures:Sequence - ________and Repetition.






49. Header file that contains commonly performed mathematical functions






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