Details of this Paper

Final Exam The exam is comprehensive over all

Description

solution


Question

;;Page 1;Multiple Choice Questions;Question 1. 1. (TCO 1) Assume you have the following declaration.;int beta[50];Which of the following is a valid element of beta? (Points: 4);beta['0'];beta['1'];beta[0];beta[50];Question 2. 2. (TCO 1) Consider the following statement.;double alpha[10][5];The number of components of alpha is ____. (Points: 4);15;50;100;150;Question 3. 3. (TCO 1) Consider the following declaration.;int j;int sum;double sale[10][7];Which of the following correctly finds the sum of the elements of the fourth column of sale? (Points: 4);sum = 0;for(j = 0, j < 10, j++);sum = sum + sale[j][3];sum = 0;for(j = 0, j < 10, j++);sum = sum + sale[j][4];sum = 0;for(j = 0, j < 7, j++);sum = sum + sale[j][4];sum = 0;for(j = 0, j sum = sum + sale[j][3];Question 4. 4. (TCO 1) Which of the following correctly declares and initializes alpha to be an array of 4 rows and 3 columns with the component type int? (Points: 4);int alpha[4][3] = {{0,1,2} {1,2,3} {2,3,4} {3,4,5}};int alpha[4][3] = {0,1,2, 1,2,3, 2,3,4, 3,4,5};int alpha[4][3] = {0,1,2: 1,2,3: 2,3,4: 3,4,5};int alpha[4][3] = {{0,1,2}, {1,2,3}, {2,3,4}, {3,4,5}};Question 5. 5. (TCO 1) What is the value of alpha[4] after the following code executes?;int alpha[5] = {0};int j;alpha[0] = 2;for (j = 1, j > r;myCircle.area = 3.14 * r * r;cout;(ii);cin>> r;myCircle.set(r);cout (Points: 4);Only (i);Only (ii);Both (i) and (ii);None of these;Page 2;Multiple Choice;Question 1. 1. (TCO 2) Consider the following class definition.;classrectangleType;public;void setLengthWidth(double x, double y);//Postcondition: length = x, width = y;void print() const;//Output length and width;double area();//Calculate and return the area of the rectangle;double perimeter();//Calculate and return the parameter;rectangleType();//Postcondition: length = 0, width = 0;rectangleType(double x, double y);//Postcondition: length = x, width = y;private;double length;double width;Which of the following class-variable declarations is correct? (Points: 4);rectanglerectangleType;class rectangleType rectangle;rectangleType rectangle;rectangle rectangleType.area;Question 2. 2. (TCO 2) Suppose you have the following UML class diagram of a class.;Which of the following is the name of the class? (Points: 4);clock;clockType;Type;ClockType

 

Paper#69499 | Written in 18-Jul-2015

Price : $37
SiteLock