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 every opening brace in a C++ program there must be a ______________.






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






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






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






5. Returns the length of a string excluding the null terminator.






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






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






8. The stream extraction operator






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






10. A function that calls itself






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






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






13. Use 2 characters to represent one






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






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






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






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






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






19. Two slash marks ( // ) indicate __________ of a comment






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






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






22. Naming convention for C++ programs






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






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






25. Function ________ is used to set the random number seed to randomize a program.






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






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






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






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






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






31. The sign you use for pointers






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






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






34. Compares two strings and returns 0 if they are equal.






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






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






37. Symbol that denotes an action to be performed






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






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






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






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






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






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






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






45. Type casting syntax






46. A function is invoked with a ________.






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






48. Program components in C++ are called functions and ________.






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






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