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 memory location with a name and data type and a value - its content (value) cannot be changed during program execution






2. All C++ Variables are_________.






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






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






5. __________ can be used to assign an object of a class to another object of the same class.






6. Whole numbers - no decimals and no commas included






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






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






9. Creates a copy of a string.






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






11. newline






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






13. Identifier or expression that is part of the calculation to be performed






14. Symbol that denotes an action to be performed






15. A filestream variable that represents the default input source






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






17. A function that calls itself






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






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






20. Used for function calls and local variables






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






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






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






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






25. The stream extraction operator






26. Use 2 characters to represent one






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






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






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






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






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






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






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






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






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






36. Causes the program to immediately goes back to the top of the loop. the remainder of the statements in the loop are ignored for this current iteration.






37. Preprocessor directive syntax






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






39. Names of things that are used in a program - can apply to variables & constants and functions






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






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






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






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






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






45. * / % + -






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






47. The __________ operator reclaims memory previously allocated by new.






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






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






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