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. directive A statement that starts with a # is called a ____________.






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






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






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






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






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






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






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






9. A filestream variable that represents the default input source






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






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






12. All C++ Variables are_________.






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






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






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






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






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






18. * / % + -






19. Most calculations are normally performed by ______ statements.






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






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






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






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






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






25. Class members specified as _________ are accessible only to member functions of the class and friends 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. Returns the length of a string excluding the null terminator.






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






29. The sign you use for pointers






30. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.






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






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






33. Use 2 characters to represent one






34. The stream insertion operator






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






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






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






38. The six possible scopes of an identifier are ________ - file scope - block scope - function-prototype scope - class scope - namespace scope .






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






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






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






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






43. The stream extraction operator






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






45. The ________ program transfers the executable image of a C++ program from disk to memory.






46. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution






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






48. You can declare default values for a function in the ____________________.






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






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