• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 36 pages
Exam (elaborations)

Programming 621 CA 23 test

Document preview thumbnail
Preview 4 out of 36 pages

Question 1 Not answered Marked out of 1.00 Flag question Question text What punctuation ends most lines of C++ code? Select one: a. '(single quote) b. :(colon) c. .(dot) d. ;(semi-colon) Feedback The correct answer is: ;(semi-colon) Question 2 Not answered Marked out of 1.00 Flag question Question text If you use same variable for two getline statements Select one: a. You can not use same variable for two getline statements b. The second input attempt fails since the variable already got its value c. Both the inputs are stored in that variable d. The second input overwrites the first one Feedback The correct answer is: The second input overwrites the first one Question 3 Not answered Marked out of 1.00 Flag question Question text What is polymorphism in object oriented programming? Select one: A. Pogramming using objects and classes to provide a well documented program. B. Is a form of software reuse in which new classes absorb the data and behaviors of existing classes and embellish these classes with new capabilities. C. Involves a base-class pointer or reference to invoke virtual functions on base-class and derived-class object. D. Classe that provides a base class from wich other classes can inherit. Feedback The correct answer is: Involves a base-class pointer or reference to invoke virtual functions on base-class and derived-class object. Question 4 Not answered Marked out of 1.00 Flag question Question text Which of the following is selection statement in C++? Select one: a. exit b. break c. switch d. goto Feedback The correct answer is: switch Question 5 Not answered Marked out of 1.00 Flag question Question text When following piece of code is executed, what happens? b = 3; a = b++; Select one: a. a contains 4 and b contains 3 b. a contains 3 and b contains 4 c. a contains 3 and b contains 3 d. a contains 4 and b contains 4 Feedback The correct answer is: a contains 3 and b contains 4 Question 6 Not answered Marked out of 1.00 Flag question Question text When deriving a class from a base class with protected iheritance, public members of base class become________members of the derived class, and protected members of the base class become________members of the derived class. Select one: A. protected, public B. protected, protected C. public, protected D. public, public Feedback The correct answer is: protected, protected Question 7 Not answered Marked out of 1.00 Flag question Question text What is the final value of x when the code int x; for(x=0; x10; x++) {} is run? Select one: a. 10 b. 1 c. 9 d. 0 Feedback The correct answer is: 10 Question 8 Not answered Marked out of 1.00 Flag question Question text Which of the following is not a looping statement in C++? Select one: a. until b. do c. while d. for Feedback The correct answer is: until Question 9 Not answered Marked out of 1.00 Flag question Question text If an array of objects is of size 10 and a data value have to be retrieved from 5th object then ________________ syntax should be used. Select one: A. Array_Name[4].data_variable_name; B. Array_Name[4].data_variable_; C. Array_Name[4].data_variable_name(value); D. Data_Type Array_Name[4].data_variable_name; Feedback The correct answer is: Array_Name[4].data_variable_name; Question 10 Not answered Marked out of 1.00 Flag question Question text What will be the output of the following C++ code? #include iostream using namespace std; void square (int *x, int *y) { *x = (*x) * --(*y); } int main ( ) { int number = 30; square(&number, &number); cout number; return 0; } Select one: A. 870 B. 9 C. 920 D. 30 Feedback The correct answer is: 870 Question 11 Not answered Marked out of 1.00 Flag question Question text You must specify void in parameters if a function does not have any arguments. Select one: a. False b. True Feedback The correct answer is: False Question 12 Not answered Marked out of 1.00 Flag question Question text Which of the following is output statement in C++? Select one: a. write b. cin c. cout d. print Feedback The correct answer is: cout Question 13 Not answered Marked out of 1.00 Flag question Question text Variables inside parenthesis of functions declarations have _____ level access. Select one: a. Universal b. Global c. Module d. Local Feedback The correct answer is: Local Question 14 Not answered Marked out of 1.00 Flag question Question text A template class Select one: a. is designed to be stored in different containers b. generates objects which must be identical c. generates classes with different numbers of member functions. d. works with different data types Feedback The correct answer is: works with different data types Question 15 Not answered Marked out of 1.00 Flag question Question text Observe following function declaration and choose the best answer: int divide ( int a, int b = 2 ) Select one: a. Variable b is international scope and will have value 2 b. Variable a and b are of int type and the initial value of both variables is 2 c. Variable b will have value 2 if not specified when calling function d. Variable b is of integer type and will always have value 2 Feedback The correct answer is: Variable b will have value 2 if not specified when calling function Question 16 Not answered Marked out of 1.00 Flag question Question text A virtual class is the same as Select one: a. a base class b. an abstract class c. a class with a virtual function d. none of the option. Feedback The correct answer is: none of the option. Question 17 Not answered Marked out of 1.00 Flag question Question text Predict the output of following C++ program #includeiostream using namespace std; class Empty {}; int main() { cout sizeof(Empty); return 0; } Select one: A. Runtime Error B. 0 C. A non-zero value D. Compiler Error Feedback The correct answer is: A non-zero value Question 18 Not answered Marked out of 1.00 Flag question Question text A copy constructor takes Select one: a. arbitrary no. of arguments b. two arguments c. one argument d. no argument Feedback The correct answer is: one argument


Document information

Uploaded on
April 11, 2025
Number of pages
36
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$14.50

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
shadow251
4.1
(60)
Sold
298
Followers
30
Items
4046
Last sold
1 month ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions

Whoops! We can’t load your doc right now. Try again or contact support.