Name_______________________
Login___________________SID________
CS 010: Introduction to
Computer Science I
Quiz 3: 10 minutes
- Which
of the following data types are NOT built-in to the language C++?
(Hint: you do not need to include a library to use a built-in type)
a.
int
b.
Time
c.
string
d.
double
e.
B
and C
f.
None of the above
- Using
the setw(8) manipulator in a cout statement will cause all
output after that to be output lined up to the right of 8 spaces?
a.
TRUE
b.
FALSE
- What
will be output by the following statements?
Time
t1(10,15,20);
cout <<
t1.get_hours();
a.
10
b.
15
c.
20
d.
10:15:20
e.
Depends on what time this program executes.
f.
None of the above
- What
will be output by the following statements?
Time t2(10,15,20);
t2.add_seconds(100);
cout << t2.get_minutes();
a.
10
b.
15
c.
20
d.
17
e.
120
f.
Depends on what time this program executes.
- What
is the value of the x coordinate of the Point p after the following
statements?
Point p(0,0);
p.move(1,2);
- 0
- 1
- 2
- None
of the above
- What
is the value of the center Point of the Circle c after the following
statements?
Point center(0,0);
Circle c(center, 2.5);
c.move(1,2);
- Point(0,0)
- Point(1,2)
- Point(1,0)
- Point(0,2)
- Point(2.5,2.5)
- None
of the above
- What
is the value of the Point variable called center after the statements in
Question 6? (BE CAREFUL! This is the A+ question on this quiz.)
- Point(0,0)
- Point(1,2)
- Point(1,0)
- Point(0,2)
- Point(2.5,2.5)
- None
of the above
- The
following statement has a syntax error (provided all appropriate libraries
were included).
cwin << Circle(Point(5,100),
5.8);
- TRUE
- FALSE
- The
second of the following statements has a syntax error (provided all
appropriate libraries were included)?
Point p;
cin >> p;
- TRUE
- FALSE
- What will be output to the graphics window given the
following code?
Point p1(0,0);
Point p2 = p1;
p2.move(0,-3);
cwin << Line(p1,p2);
p2 = p1;
p1.move(-1,0);
p2.move(1,0);
Line line1(p1,p2);
cwin << line1;
line1.move(0,-3);
cwin << line1;
- A
shape in the form of a capital F
- A
shape in the form of a capital C
- A shape in the form of a
capital I
- A
shape in the form of a triangle
- A
shape in the form of a rectangle
- 3
parallel lines