EC327 2009 Lab3

EC327 2009 Lab3 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EC327
Introduction
to
Software
Engineering
 Lab
#2
–
Due
Wednesday
Oct.
28,
2009
‐
8
pm.
 Name:
___________________
 BUID:
___________________
 Lab
guidelines:
 You
are
expected
to
do
individual
work
on
lab
assignments.

You
are
welcome
to
discuss
the
general
 approach
with
classmates,
but
all
final
work
must
be
done
individually.

Please
refer
to
the
Collaboration
 section
of
the
class
syllabus.

Labs
should
be
demonstrated
to
the
Lab
Assistant
or
the
U/GTF
during
lab
 hours
in
PHO
307
(unless
otherwise
indicated),
and
all
code
must
be
printed
out
and
handed
in
along
with
 this
grading
sheet
at
the
same
time.

 
 Part
1
[50
points]
 Do
Lab
2’s
second
problem
(the
histogram
problem),
but
this
time
with
pointers
and
 structures!

You
are
more
than
welcome
(and
encouraged)
to
use
your
code
from
Lab
2.
 Part
1.2
[10
points]
 Describe
your
experience
in
revisiting
your
code
a
week
later.

What
did
you
notice
 about
your
code,
its
readability,
comments,
etc.,
How
much
of
your
code
did
you
have
 to
change
and
why
do
you
think
it
was
so
little
or
so
much?
 
 Part
2
[40
pts]
 Write
a
program
that
takes
a
string
input
from
the
user
and
generates
a
new
string
 which
is
a
combination
of
two
things:
 First,
the
string
should
get
mangled
up
in
a
way
that
keeps
the
first
and
last
characters
 of
each
word,
but
randomly
rearranges
the
internal
characters.

i.e.
“Hello
there”
would
 become
“Hlelo
terhe”.

Use
the
C
rand()
function
to
get
random
numbers.
 Second,
this
new
string
should
be
attached
to
the
original
string
in
a
manner
as
to
 generate
the
following
output:
 “Hello
there
‐
Hlelo
terhe”
 You
must
use
pointers
(no
arrays),
and
the
buffer
size
for
words
and
strings
must
be
 precise
(i.e.
you
should
no
longer
assume
words
are
a
maximum
of,
say,
80
characters).

 You
are
welcome
to
use
the
standard
string
library
(strcpy,
strcmp,
etc.).

You
must
also
 use
at
least
two
functions,
one
which
returns
the
mangled
up
words,
and
another
which
 returns
a
mangled
up
combined
sentence.
 Extra
credit
[15
pts]
 Read
in
a
file
and
display
only
the
mangled
results.

What
do
you
notice
about
the
 mangled
words
that
you
have
generated?


 [









]
pts
 EC327
Introduction
to
Software
Engineering
 Lab
#2
–
Due
Wednesday
Oct.
28,
2009
‐
8
pm.
 Important:
 From
now
on
please
provide
a
screen
capture
of
your
code
output.

To
do
this,
use
the
 typescript
command,
capture
the
output,
and
print
it
along
with
your
code.

Do
“man
 typescript”
on
a
linux
prompt
for
its
usage.
 

 Please
print
and
staple
all
source
code
to
this
grading
sheet
when
handing
in.
 Date
Handed
in:
___________
 
 Grader:
___________
 
 Score:
___________
 ...
View Full Document

This note was uploaded on 11/09/2010 for the course ECE 327 taught by Professor Babakkia during the Fall '09 term at BU.

Ask a homework question - tutors are online