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 idea that you can call the same function and the output will depend on the type of object you're using.






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






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






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






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






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






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






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






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






10. Symbol that denotes an action to be performed






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






12. tab






13. Type casting syntax






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






15. Creates a copy of a string.






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






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






18. Function ________ is used to produce random numbers.






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






20. In inheritance the ____________ is the class the receives the inherited members.






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






22. int namespace include using return examples of ___________






23. A nonmember function must be declared as a(n) __________ of a class to have access to that class's private data members.






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






25. Keyword public is a(n) _________






26. Most calculations are normally performed by ______ statements.






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






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






29. Naming convention for C++ programs






30. A filestream variable that represents the default output device






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






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






33. A function is invoked with a ________.






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






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






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






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






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






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






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






41. Executable version of program






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






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






44. Syntax for named constant declaration






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






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






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






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






49. The sign you use for references






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