Clicker Questions

Week 2 - OOP

Opinion 1:

How do you create a new Point Object?
  1. Point p = Point(3,2);
  2. Point p(3,2);
  3. p=Point(3,2);
  4. Point p = Point::Point(3,2);
  5. Point p = new Point(3,2);

Question 2:

Consider the following code snippet
int x = 7;
int y = 11;
Point p(3,2);
p.setX(y);
p.print();
  
What is the output of this program?
  1. (3, 11)
  2. (7, 11)
  3. (11, 2)
  4. (3, 2)
  5. This will generate an error

Question 3:

On the pointer worksheet what are the values of *p and *q?
  1. 40 and 40
  2. 40 and 0x80
  3. 0x80 and 0x7b
  4. 0x78 and 0x70
  5. This will generate an error

Question 4:

On the pointer worksheet what are the values of a and b after the increments?
  1. 40 and 40
  2. 41 and 40
  3. 42 and 40
  4. 42 and 42
  5. This will generate an error

Question 5:

On the pointer worksheet what are the values of a and b after the increments?
  1. 42 and 40
  2. 42 and 41
  3. 42 and 42
  4. 43 and 40
  5. This will generate an error