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. The storage-class specifiers are mutable - auto - ________ - extern and static.






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






3. An expression in which all operands have the same data type - result will have the same data type as operands






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






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






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






7. The ________ of an identifier is the portion of the program in which the identifier can be used.






8. Whole numbers - no decimals and no commas included






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






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






11. The symbol for the binary scope resolution operator






12. Syntax for named constant declaration






13. A pointer is a variable that contains as its value the____________ of another variable.






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






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






16. Most calculations are normally performed by ______ statements.






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






18. A filestream variable that represents the default output device






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






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






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






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






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






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






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






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






27. An expression that has operands with different data types






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






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






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






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






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






33. The stream insertion operator






34. The escape sequence ___ when output with cout and the stream insertion operator - causes the cursor to position to the beginning of the next line on the screen.






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






36. A sequence of operands and operators that describe a calculation to be performed






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






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






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






40. Executable version of program






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






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






43. int namespace include using return examples of ___________






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






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






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






47. newline






48. A function ________ enables a single function to be defined to perform a task on many different data types.






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






50. It is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________.