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. You can reassign the operator features in C++ to do things other than what they would do naturally. This is called ____________






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






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






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






5. tab






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






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






8. Associate an identifier with a memory location






9. A variable that is known only within the function in which it is defined is called a ________.






10. Header file that contains commonly performed mathematical functions






11. Variables declared in a block or in the parameter list of a function are assumed to be of storage class ________ unless specified otherwise.






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






13. Whole numbers - no decimals and no commas included






14. The process of analyzing and designing a system from an object-oriented point of view is called ________.






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






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






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






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






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






20. A filestream variable that represents the default input source






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






22. The keyword __________ specifies that an object or variable is not modifiable after it is initialized.






23. * / % + -






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






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






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






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






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






29. Syntax for named constant declaration






30. Keyword public is a(n) _________






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






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






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






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






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






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






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






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






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






40. A variable declared outside any block or function is a ________ variable.






41. A set of values together with a set of operations






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






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






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






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






46. A function that calls itself






47. The only integer that can be assigned directly to a pointer is_____________.






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






49. Operator with two operands






50. Function ________ is used to produce random numbers.