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. This happens when too much memory is pushed onto the stack and overflows to other areas of memory.






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






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






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






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






6. All C++ Variables are_________.






7. Creates a copy of a string.






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






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






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






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






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






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






14. Operator with two operands






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






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






17. data types that refer to numbers with decimals






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






19. The process of placing the elements of an array in order is called ________ the array.






20. Function ________ is used to produce random numbers.






21. Symbol that denotes an action to be performed






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






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






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






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






26. Whole numbers - no decimals and no commas included






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






28. For every opening brace in a C++ program there must be a ______________.






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






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






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






32. Executable version of program






33. A memory location with a name and data type and a value - its content (value) cannot be changed during program execution






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






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






36. Used for function calls and local variables






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






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






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






40. The ________ statement in a called function passes the value of an expression back to the calling function.






41. Default name of executable file






42. A file must be ________ before data can be written to or read from it.






43. Nonexecutable statements that are included in a program to provide information about what the program does etc.






44. newline






45. Type casting syntax






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






47. OOD also takes advantage of ________ relationships where new classes of objects are derived by absorbing characteristics of existing classes - then adding unique characteristics of their own.






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






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






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