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






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






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






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






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






6. Type casting syntax






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






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






9. data types that refer to numbers with decimals






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






11. Can be used as a compound "if" statement. it includes a number of different possibilities and directions rather than a single test.






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






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






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






15. The four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.






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






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






18. When it is not known in advance how many times a set of statements will be repeated a _________value can be used to terminate the repetition.






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






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






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






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






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






24. The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.






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






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






27. A filestream variable that represents the default input source






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






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






30. Most calculations are normally performed by ______ statements.






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






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






33. A variable that holds the address of another variable.






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






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






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






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






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






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






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






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






42. When a value of one data type is implicitly (automatically) changed to another data type






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






44. Class members specified as _________ are accessible anywhere an object of the class is in scope.






45. The stream insertion operator






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






47. The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.






48. Objects have the property of ________although objects may know how to communicate with one another across well-defined interfaces - they normally are not allowed to know how other objects are implemented.






49. Used for function calls and local variables






50. Repeating a set of instructions a specific number of times is called_________repetition.