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






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






3. Member objects are constructed __________ their enclosing class object.






4. Objects have the property of ________although objects may know how to communicate with one another across well-defined interfaces - they normally are not allowed to know how other objects are implemented.






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






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






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






8. When the compiler sees this keyword the function call is replaced with a copy of the contents of the function itself.






9. A human readable file that contains C++ program






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






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






12. Operator with only one operand






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






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






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






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






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






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






19. * / % + -






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






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






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






23. Associate an identifier with a memory location






24. Comments do not cause the computer to print the text after the____ on the screen when the program is executed.






25. Naming convention for C++ programs






26. The stream extraction operator






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






28. Type casting syntax






29. A function that calls itself






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






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






32. An object's non-static member functions have access to a "self pointer" to the object called the __________ pointer.






33. newline






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






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






36. Used for function calls and local variables






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






38. Whole numbers - no decimals and no commas included






39. Syntax for named constant declaration






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






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






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






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






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






45. Function ________ is used to produce random numbers.






46. data types that refer to numbers with decimals






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






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






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






50. The stream insertion operator