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 four areas that a program uses memory on are: the codes area - the _______ area - the stack and the heap.






2. data types that refer to numbers with decimals






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






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






5. The stream insertion operator






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






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






8. This manipulator causes the field to be left-justified with padding spaces printed to the right.






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






10. Allows the programmer to store a value in a variable






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






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






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






14. Initializers __________ must be used to initialize constant members of a class.






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






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






17. Associate an identifier with a memory location






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






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






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






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






22. * / % + -






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






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






25. Lists and tables of values can be stored in arrays or __________.






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






27. A C++ statement that makes a decision is ______.






28. All ______ must be declared before they are used.






29. Function ________ is used to produce random numbers.






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






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






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






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






34. A filestream variable that represents the default input source






35. Most calculations are normally performed by ______ statements.






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






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. = & | are examples of ____________.






39. The sign you use for pointers






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






41. A recursive function typically has two components: One that provides a means for the recursion to terminate by testing for a(n) ________ case and one that expresses the problem as a recursive call for a slightly simpler problem than the original call






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






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






44. Header file that contains commonly performed mathematical functions






45. Use 2 characters to represent one






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






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






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






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






50. The ________ program transfers the executable image of a C++ program from disk to memory.