💻 Computing Solved MCQs with Answers

Practice 1954 approved 💻 Computing questions with verified answers from the 💾 Computer Science subject for Pakistan exams.

1954 solved MCQs

A function that returns no values to the program that calls it is _____Answer: type void The keyword used to define a structure is _____Answer: struct If container classes are carefully constructed, then these tools are available to work with structures that are not ______Answer: type-specific Header files often have the file extension _____Answer: .H The #ifndef directive tests to see whether ________Answer: a class has been defined Which of the following statements is false?Answer: Functions can be called, or invoked, only once in a program The generic type in a template functionAnswer: can be T When a child class function is called, the compiler looks first for a matching function name in the _____Answer: class of the object using the function name A function that is called automatically each time an object is destroyed is aAnswer: destructor If you create an instantiation of a class template with an int, and then create a second instantiation with a double, thenAnswer: you must precede each function call with the word int or double The step-by-step instructions that solve a problem are called _____Answer: an algorithm The type to be used in an instantiation of a class template follows ________Answer: the generic class name Which of the following statements allows the user to enter data at the keyboard?Answer: cin >> currentPay; When you pass a variable _____, C++ passes only the contents of the variable to the receiving functionAnswer: by value The best form of coupling is _____Answer: loose Paying attention to the important properties while ignoring inessential details is known as________Answer: abstraction What does C++ append to the end of a string literal constant?Answer: a null character An array name is a _____Answer: memory address To enter a comment in a C++ program, you begin the comment with _____Answer: // Which of the following is(are) invalid string constant(s)?Answer: '7.15 pm' You define a structure type globally because _____Answer: you save many lines of code by not rewriting an identical structure definition in each function that uses it Overloaded functions are required toAnswer: None of the above Redirection redirectsAnswer: a stream from a file to the screen You mark the beginning of a function's block of code with the _____Answer: { Sending a copy of data to a program module is called _______Answer: passing a value Of the three ways to pass arguments to functions, only passing by _____ and passing by _____ allow the function to modify the argument in the calling programAnswer: reference, pointer To use either an input or output file, the program must include the _____ header fileAnswer: fstream.h A widget is to the blueprint for a widget as an object is toAnswer: a class C++ allows you to define the same functions more than once in the same program _____Answer: C++ does not allow you to define the same functions more than once in the same program Which of the following assigns the number 5 to the area variable?Answer: area = 5