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_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.






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






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






4. The idea that you can call the same function and the output will depend on the type of object you're using.






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






6. Sets floating-point values to a fixed decimal format






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






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






9. A __________ data member represents class-wide information.






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






11. The stream insertion operator






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






13. = & | are examples of ____________.






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






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






16. This manipulator is used to establish a field width for the value immediately following it.






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






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






19. A member function should be declared static if it does not access __________ class members.






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






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






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






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






24. A constant object must be __________; it cannot be modified after it is created.






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






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






27. Whole numbers - no decimals and no commas included






28. Naming convention for C++ programs






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






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






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






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






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






34. Most calculations are normally performed by ______ statements.






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






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






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






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






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






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






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






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






43. Smallest individual unit of a programming language - special symbols or word symbols or identifiers






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






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






46. Operator with only one operand






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






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






49. This allows the writer to create functions of the same name as long as they have different parameters or different quantities of parameters.






50. The sign you use for references