Beruflich Dokumente
Kultur Dokumente
5.
All
code
and
input
is
written
in
a
fixed
width
font.
If
it
looks
like
a
space,
it
is
a
space.
6.
Write
clearly.
If
we
cannot
read
your
writing,
it
will
be
marked
wrong.
7.
This
course
operates
under
the
rules
of
the
College
of
Engineering
Honor
Code.
Your
signature
endorses
the
pledge
below.
After
you
finish
your
exam,
sign
below:
I
have
neither
given
nor
received
aid
on
this
examination,
nor
have
I
concealed
any
violations
of
the
Honor
Code.
__________________________________________________________________
Question 1
Question 2 a
Question 2 b
Question 4
Total
Points
Possible
30
40
40
30
140
Points Received
void
Holder::print()
{
for
(int
i
=
0;
i
<
size;
++i)
{
cout
<<
items[i]
<<
"
";
}
cout
<<
endl;
}
int
main()
{
Holder
h(1);
h.print();
h.insert(3);
h.insert(4);
h.print();
h.insert(3);
h.print();
h.remove(3);
h.print();
return 0;
0
034
0343
0040
0
struct
Student
{
string
name;
int
age;
};
struct
Course
{
string
name;
int
courseId;
string
professor;
int
numStudents;
Student
students[MAX_STUDENTS];
};
age
9
12
courseID
32991
92911
professor
Ms.
Frizzle
Mr.
Crocker
numStudents
1
1
students
Arnold,
9
Timmy,
12
Student
arnold
=
{"Arnold",
9};
Student
timmy
=
{"Timmy",
12};
Course
science
=
{"Science",
32991,
"Ms.
Frizzle",
1,
arnold};
Course
math
=
{"Math",
92911,
"Mr.
Crocker",
1,
timmy};
return
0;
}
3. (30 pts) Draw a line through unnecessary code that still allows these two