Part I due by 11:59 p.m. on Thursday, October 3, 2024.
Part II due by 11:59 p.m. on Sunday, October 6, 2024.
In your work on this assignment, make sure to abide by the collaboration policies of the course.
If you have questions while working on this assignment, please
come to office hours, post them on Piazza, or email
cs111-staff@cs.bu.edu
.
Make sure to submit your work on Gradescope, following the procedures found at the end of Part I and Part II.
Create a subfolder called ps3
within your
cs111
folder, and put all of the files for this assignment in that
folder.
Problems 0 and 1 will be completed in a single PDF file. To create it, you should do the following:
Access the template that we have created by clicking on this link and signing into your Google account as needed.
When asked, click on the Make a copy button, which will save a copy of the template file to your Google Drive.
Select File->Rename, and change the name of the file to
ps3pr01
.
Add your work for Problems 0 and 1 to this file.
Once you have completed all of these problems, choose
File->Download->PDF document, and save the PDF file in your ps3
folder. The resulting PDF file (ps3pr01.pdf
) is the one that you
will submit. See the submission guidelines at the end of Part I.
5 points; individual-only
Your work thus far in CS 111 has probably given you many opportunities to deal with bugs in your code! Some bugs are obvious, while others can only be discovered with careful testing.
In a large, complex software system, it can be difficult to find every bug, and the failure to do so can sometimes result in catastrophic consequences. This week’s reading involves just such a catastrophic bug–one that led to the destruction of an expensive rocket known as the Ariane 5. And it turns out that the bug in question was directly related to the bit-level representation of data that we have been covering in class.
The article, by historian of science James Gleick, is available here.
After you have read it, write a response that addresses–at least to some extent–the following prompt:
Which contributing factor within the bug’s origins (there are many!) strikes you as the “most preventable” and why? Of course, this will be in hindsight.
Put your response in the copy of the ps3pr01
template that you
created on Google Drive (see above). As always, a few carefully
considered sentences that reflect your critical thinking about the
article will more than suffice.
15 points; individual-only
Consider the following Python program:
def mystery1(wordlist): """ takes a list of words and does something with them """ scored_words = [[w[-1], w] for w in wordlist] best_pair = max(scored_words) return best_pair[1] print(mystery1(['make', 'your', 'vote', 'count']))
In section 1-1 of ps3pr01
, we have given you a table that you
should complete to illustrate the execution of the list
comprehension during the call to mystery1
in the program above.
In the column for scored_words
, you should show the how the
result of the list comprehension is gradually built up. In other
words, for each new value of the list comprehension’s “runner”
variable w
, you should show the current partial result of the
list comprehension.
You may not need all of the rows provided in the table.
We are taking a similar approach to tracing in Tasks 1 and 2 of Lab 4.
What value is assigned to the variable best_pair
during the
call to mystery1
in the program above? Put your answer in the box
provided.
What value is returned by the call to mystery1
in the program above?
Put your answer in the box provided.
Consider the following recursive function:
def mystery2(s): """ takes an arbitrary string s and does something with it """ if len(s) <= 1: return s else: result_rest = mystery2(s[1:-1]) if s[0] > s[-1]: return result_rest else: return result_rest + s[0]
Trace the execution of the following call to this function.
mystery2('pizzazz')
To do so, complete the template that we have provided in
section 1-4 section of ps3pr01
. In particular, you should:
Fill in a separate “frame” for each call. We have filled in some of the components of the first two calls for you, and we have given you templates for up to four additional calls.
You may not need all of the provided frames.
You should replace each ...
with the appropriate string.
In particular, the frame for each call should begin with lines
that explicitly state the values assigned to the parameters, as
we have done for the first two calls.
Next, if the call is a base case, you should:
Replace the entire line for result_rest
with the words
base case
.
Replace the ...
after the word return
with the
value that is returned.
If the call is a recursive case, you should fill in the value
that is being passed into the recursive call on the line for
result_rest
(as we have done for the first call).
Once you have reached the base case, you should work your way
back through the sections for the previous calls. Fill in both
the results of the recursive call (i.e, the value assigned to
result_rest
) and the value returned by the call itself.
We took a similar approach to tracing in Task 1 of Lab 3, and in Problem 2 of PS 2.
What is the final result of the call mystery2('pizzazz')
?
Put your answer in the box provided.
25 points; pair-optional
This is the only problem of the assignment that you may complete with a partner. See the rules for working with a partner on pair-optional problems for details about how this type of collaboration must be structured.
This problem provides additional practice with list comprehensions and recursion. It also provides an opportunity to use the list-of-lists technique that we discussed in lecture.
The guidelines that we gave you for Problem 3 and Problem
4 of Problem Set 2 also apply here, except that some of the
functions will not use recursion. In particular, you may not
use any iterative constructs that you may be aware of (for
, while
,
etc.), and you must use the exact function names that we have specified.
Getting started
If you haven’t already done so, create a folder named ps3
for your work on this assignment. You can find instructions for
doing so here.
In Spyder, open a new editor window using File -> New File,
and save it to your ps3
folder using the name ps3pr2.py
.
The functions
Write a function cube_all_lc(values)
that takes as input a list
of numbers called values
, and that uses a list comprehension
to create and return a list containing the
cubes of the numbers in values
(i.e., the numbers raised to the
third power). For example:
>>> cube_all_lc([-2, 5, 4, -3]) result: [-8, 125, 64, -27] >>> cube_all_lc([1, 2, 3]) result: [1, 8, 27]
This version of the function may not use recursion.
Write a function cube_all_rec(values)
that takes as input a list
of numbers called values
, and that uses recursion
to create and return a list containing the
cubes of the numbers in values
. In other words,
this function will do the same thing as the previous function,
but it must use recursion instead of a list comprehension.
For example:
>>> cube_all_rec([-2, 5, 4, -3]) result: [-8, 125, 64, -27] >>> cube_all_rec([1, 2, 3]) result: [1, 8, 27]
This version of the function may not use a list comprehension. Instead, the function must call itself recursively.
Write a function consonants(s)
that takes as input a string s
and uses a list comprehension to create and return a
list containing the consonants (if any) in s
. For
example:
>>> consonants('computer') result: ['c', 'm', 'p', 't', 'r'] >>> consonants('science') result: ['s', 'c', 'n', 'c'] >>> consonants('aeiou') result: []
You may assume that the string s
contains only lowercase letters,
and thus any letter that is not a vowel
(i.e., any letter other than 'a'
, 'e'
, 'i'
, 'o'
, or 'u'
)
is a consonant.
This function may not use recursion.
Hints:
Your list comprehension will need an if
clause.
In the same way that we’ve used the in
operator to check for
whether a letter is a vowel, you can use the not in
operator
to check if a letter is not a vowel. Here are two examples
of expressions that use not in
:
>>> 'i' not in 'team' result: True >>> 't' not in 'test' result: False
Write a function num_consonants(s)
that takes as input a
string s
and that uses your consonants
function from part 3
to determine and return the number of consonants in
s
. For example:
>>> num_consonants('computer') result: 5
Here again, you may assume that the string s
contains only
lowercase letters.
Important: In Lab 3, we considered a version of this function that used recursion. For this problem, you may not use recursion. Rather, you should take one of the following approaches:
Use a list comprehension in conjunction with the sum
function. In the lecture on list comprehensions, we considered
some functions that used this approach to count how many
elements of a sequence satisfied a condition. You could take a
similar approach here.
== OR ==
Have your num_consonants
function call your consonants
function from part 3 as a helper function, and use the value
that you get back from that call to determine and return the
number of consonants.
Write a function called most_consonants(wordlist)
that takes a
list of lowercase words called wordlist
and returns the word in the
list with the most consonants. For example:
>>> most_consonants(['computer', 'science']) result: 'computer' >>> most_consonants(['python', 'is', 'fun']) result: 'python'
The function that you write must use your
num_consonants
function from part 4 as a helper function.
In addition, we strongly encourage you to use the list-of-lists
technique that we discussed in lecture as the basis of your
most_consonants
function, but you may use recursion instead if
you prefer.
You don’t need to worry about cases in which two or more words are tied for the most consonants.
Login to Gradescope by clicking the link in the left-hand navigation bar, and click on the box for CS 111.
You will make submissions to two separate assignments on Gradescope. The steps needed for the two submissions are different, so please make sure to follow carefully the procedures outlined below.
PS 3: Problems 0 and 1
Submit your ps3pr01.pdf
file using these steps:
If you still need to create a PDF file, open your file
on Google Drive, choose File->Download->PDF document, and
save the PDF file in your ps3
folder.
Click on the name of the assignment in the list of assignments on Gradescope. You should see a pop-up window labeled Submit Assignment. (If you don’t see it, click the Submit or Resubmit button at the bottom of the page.)
Choose the Submit PDF option, and then click the Select PDF button and find the PDF file that you created. Then click the Upload PDF button.
You should see a question outline along with thumbnails of the pages from your uploaded PDF. For each question in the outline:
As you do so, click on the magnifying glass icon for each page and doublecheck that the pages that you see contain the work that you want us to grade.
Once you have assigned pages to all of the problems in the question outline, click the Submit button in the lower-right corner of the window. You should see a box saying that your submission was successful.
If needed, use the Resubmit button at the bottom of the page to resubmit your work.
PS 3: Problem 2
IMPORTANT: If you chose to work on this pair-optional problem with a partner, only one person from the pair should submit the file, and that person should add the other person as a group member following step 6 below.
Submit your ps3pr2.py
file using these steps:
Click on the name of the assignment in the list of assignments. You should see a pop-up window with a box labeled DRAG & DROP. (If you don’t see it, click the Submit or Resubmit button at the bottom of the page.)
Add your file to the box labeled DRAG & DROP. You can either drag and drop the file from its folder into the box, or you can click on the box itself and browse for the file.
Click the Upload button.
You should see a box saying that your submission was successful.
Click the (x)
button to close that box.
The Autograder will perform some tests on your file. Once it is done, check the results to ensure that the tests were passed. If one or more of the tests did not pass, the name of that test will be in red, and there should be a message describing the failure. Based on those messages, make any necessary changes. Feel free to ask a staff member for help.
Note: You will not see a complete Autograder score when you submit. That is because additional tests for at least some of the problems will be run later, after the final deadline for the submission has passed. For such problems, it is important to realize that passing all of the initial tests does not necessarily mean that you will ultimately get full credit on the problem. You should always run your own tests to convince yourself that the logic of your solutions is correct.
If you worked with a partner and you are the one who is submitting the file:
Click on the Add Group Member link that appears below your name above the results of the Autograder.
In the pop-up box that appears, click on the Add Member link.
Type your partner’s name or choose it from the drop-down menu.
Click the Save button.
Check to ensure that your partner’s name now appears below your name above the results of the Autograder.
If needed, use the Resubmit button at the bottom of the page to resubmit your work.
Near the top of the page, click on the box labeled Code. Then click on the name of the file to view its contents. Check to make sure that the file contains the code that you want us to grade.
Important
It is your responsibility to ensure that the correct version of every file is on Gradescope before the final deadline. We will not accept any file after the submission window for a given assignment has closed, so please check your submissions carefully using the steps outlined above.
If you are unable to access Gradescope and there is enough
time to do so, wait an hour or two and then try again. If you
are unable to submit and it is close to the deadline, email
your homework before the deadline to
cs111-staff@cs.bu.edu
25 points; individual-only
This problem asks you to write two functions using aspects of
functional programming that we have covered in class: conditionals,
recursion, and/or list comprehensions. The guidelines that we gave you
for Problem 3 and Problem 4 of Problem Set 2 also
apply here, except that some of the functions will not use
recursion. In particular, you may not use any iterative
constructs that you may be aware of (for
, while
, etc.), and you
must use the exact function names that we have specified.
Begin by downloading this file: ps3pr3.py
Make sure to put the file in your ps3
folder. If your browser
doesn’t allow you to specify where the file should be saved, try
right-clicking on the link above and choosing Save as... or
Save link as..., which should produce a dialog box that allows you
to choose the correct folder for the file.
Open the file in Spyder. You should see:
a template for a helper function called rotate
that you will
implement
another (already completed) helper function called
letter_score
that you will use when writing one of the other
required functions.
Here are the functions you must write:
Complete the function rotate(c, n)
, which takes as inputs a single
character c
and a non-negative integer n
between 0 and 25,
and that returns a single character that is based on c
.
If c
is a letter of the alphabet, the function should
“rotate” it by n
characters forward in the alphabet, wrapping
around as needed. For example:
>>> rotate('a', 1) result: 'b' >>> rotate('B', 3) result: 'E'
Upper-case letters should be “rotated” to upper-case letters, even if you need to wrap around. For example:
>>> rotate('Y', 3) result: 'B'
Lower-case letters should be “rotated” to lower-case letters:
>>> rotate('y', 5) result: 'd'
Non-alphabetic characters should be left unchanged:
>>> rotate('!', 4) result: '!'
Guidelines
This function does not require recursion or a list comprehension.
We have given you a template for this function in ps3pr3.py
.
The starter code that we have provided checks to ensure that c
is a single-character string. Complete the function so that it
returns the correct result in all cases.
We wrote a function called rot13(c)
in lecture. It
takes a single character c
and always rotates it 13 spots
forward in the alphabet. You should use that function as a
model for your rotate
function. Very few changes will be
needed!
Just as we did in rot13
, you can:
use the built-in functions ord
and chr
to convert from
a single-character string to an integer and back again
use the following test to determine if the input c
is between 'a'
and 'z'
in the alphabet:
if 'a' <= c <= 'z':
use a similar test to test if c
is an upper-case letter.
Write a function encipher(s, n)
that takes as inputs an
arbitrary string s
and a non-negative integer n
between 0 and
25, and that uses recursion to create and return a new
string in which the letters in s
have been “rotated” by n
characters forward in the alphabet, wrapping around as needed.
Upper-case letters should be rotated to upper-case letters,
lower-case letters should be rotated to lower-case letters, and
non-alphabetic characters should be left unchanged.
For example:
>>> encipher('hello', 1) result: 'ifmmp' >>> encipher('hello', 2) result: 'jgnnq' >>> encipher('ABCXYZ', 3) result: 'DEFABC' >>> encipher('xyzabc', 4) result: 'bcdefg' >>> encipher('#caesar!', 2) result: '#ecguct!'
In addition to calling itself recursively, the function must
call your rotate
function to determine the rotated version
of a given character. Doing so will make your encipher
function
much easier to write!
Once you think you have everything working, here are three more examples to try:
>>> encipher('xyza', 1) result: 'yzab' >>> encipher('Z A', 2) result: 'B C' >>> encipher('Caesar cipher? I prefer Caesar salad.', 25) result: 'Bzdrzq bhogdq? H oqdedq Bzdrzq rzkzc.'
Hint: The structure of this function should end up being
similar to the scrabble_score
function that you wrote for
Problem Set 2. In the same way that scrabble_score
called letter_score
to determine the score of a single letter
and added it to the score of the rest of the word, encipher
should call rotate
to determine the rotated version of a given
character and use concatenation to add it to the rotated
version of the rest of the string.
In our starter code for ps3pr3
, we’ve given you a fully
implemented function called letter_score(c)
that takes a
single-character string c
and returns a numeric score that is
based on the frequency with which that character appears in
English-language text documents. For example:
>>> letter_score('t') result: 0.0737 >>> letter_score('m') result: 0.0205
Note that the score for 't'
is higher than the score for 'm'
,
because 't'
occurs more frequently in English-language text
documents than 'm'
does.
You should not modify letter_score
. Rather, you will
use it as a helper function in your next function.
Write a function called string_score(s)
that takes an arbitrary
string s
and that uses either recursion OR a list comprehension
to compute and return the sum of the letter-score values of the
characters in s
. Your function must call the provided
letter_score
function as a helper function to determine the
score of a given letter.
Here’s one example of how it should work:
>>> string_score('then') result: 0.2853
Note that this call returns 0.2853
, which is the sum of the
letter scores of 't'
, 'h'
, 'e'
and 'n'
.
Here are two other examples:
>>> string_score('caesar') result: 0.3497 >>> string_score('brutus') result: 0.2274
Write a function decipher(s)
that takes as input an arbitrary
string s
that has already been enciphered by having its
characters “rotated” by some amount (possibly 0). The function
should return, to the best of its ability, the original
English string, which will be some rotation (possibly 0) of the
input string s
. For example:
>>> decipher('Bzdrzq bhogdq? H oqdedq Bzdrzq rzkzc.') result: 'Caesar cipher? I prefer Caesar salad.'
Note that decipher
does not take a number specifying the
amount of rotation! Rather, it should determine the rotation (out
of all possible rotations) that produces the most plausible
English string.
Here is the approach that you should take:
Start by using a list comprehension to create a list of all possible decipherings, and assign that list to a variable. You should end up with a line of code that looks like this:
options = [_____________ for n in ____________]
You need to consider all possible shifts – from 0 to 25 – that could be used to create a deciphering, and thus the second blank above should be replaced with an expression that produces the necessary sequence of integers.
And since deciphering involves rotating a string, you’ve already written the function needed to create each of the possible decipherings! You should make the appropriate call to it in the first blank above.
Next, use the “list-of-lists” technique that we discussed in
lecture to assign a numeric score to each of the possible
decipherings in options
. The best_word
function from
lecture is a good example of this technique.
Call your string_score
function to provide the score of each
option. Because the scores that string_score
provides are
based on how frequently the individual characters appear in
English documents, strings that are more likely to be English
phrases should end up with higher scores!
After you have scored all of the options, you should choose
the option with the highest score and return it. Here again, the
best_word
function from lecture is a good model for what you
need to do.
Once you think you have a working decipher
, try it on the
following string:
'kwvozibctibqwva izm qv wzlmz nwz iv mfkmttmvb rwj'
Your function does not need to be perfect. Some strings have more than one English “deciphering.” In addition, it’s difficult if not impossible to handle very short strings correctly. However, your function should work almost all of the time on long stretches of English text (e.g., sentences of 8 or more words).
Here are two more examples:
>>> decipher('Hu lkbjhapvu pz doha ylthpuz hmaly dl mvynla lclyfaopun dl ohcl slhyulk.') result: 'An education is what remains after we forget everything we have learned.' >>> decipher('python') result: 'eniwdc'
Note that our version of decipher
gets the second example wrong!
(When you provide English text as the input, you should ideally
get back the text itself–i.e., a string that has been deciphered
using a rotation of 0–but that didn’t happen in this case, which is
completely okay!)
30 points; individual-only
This problem asks you to write some additional functions using the functional-programming techniques that we have discussed in lecture.
In Spyder, open a new editor window using File -> New File,
and save it to your ps3
folder using the name ps3pr4.py
.
In writing the functions described below, you should continue to follow the guidelines from Problem 3.
Here are the descriptions of the functions:
Write a function rem_first(c, s)
that takes as inputs a single
character c
and an arbitrary string s
and that uses
recursion to create and return a version of s
in which
only the first occurrence of c
(if any) has been removed. For
example:
>>> rem_first('a', 'bananas') result: 'bnanas' >>> rem_first('n', 'bananas') result: 'baanas' >>> rem_first('x', 'bananas') # no occurrences result: 'bananas' >>> rem_first('a', '') result: ''
In lecture, we wrote a rem_first
function that
removed the first occurrence of a given value from a list. You
should rewrite that function so that it operates on a string
rather than a list.
We will discuss this function in lecture on Wednesday of this week.
Write a function jscore(s1, s2)
that takes two strings s1
and
s2
as inputs and that uses recursion to compute and
return the Jotto score of s1
compared with s2
– i.e., the number of characters in s1
that are shared by
s2
. The positions and the order of the shared characters within
each string do not matter. Repeated letters are counted multiple
times, as long as they appear multiple times in both strings. For
example:
>>> jscore('diner', 'syrup') # just the 'r' result: 1 >>> jscore('always', 'bananas') # two 'a's and one 's' result: 3 >>> jscore('always', 'walking') # one 'a', 'l', and 'w' result: 3 >>> jscore('recursion', 'excursion') # everything but the 'r' in s1 is shared by s2 result: 8
If either s1
or s2
is the empty string, the Jotto score is 0:
>>> jscore('recursion', '') result: 0 >>> jscore('', 'recursion') result: 0
Notes/hints:
As discussed in lecture, the steps that you need to take in
recursive case will depend on whether the first character of
s1
appears in s2
.
If the first character of s1
appears somewhere in s2
, you
need to remove one occurrence of that character from s2
and pass that modified string into the recursive call, along
with the usual “shortened” version of s1
. For example,
if we are processing this call:
jscore('always', 'bananas')
the recursive call should be:
jscore('lways', 'bnanas')
Note that we need to remove the one 'a'
from 'bananas'
to
get the second input to the recursive call. You can do this
by making a call to your rem_first
function!
If the first character of s1
does not appear anywhere in s2
,
s2
should be passed unchanged into the recursive call.
For example, if we are processing this call:
jscore('yummy', 'bananas')
the recursive call should be:
jscore('ummy', 'bananas')
Here is a template for one possible approach:
def jscore(s1, s2): """ docstring goes here """ if you have a base case: return the appropriate score else: if s1[0] in s2: jscore_rest = jscore(_______, rem_first(____, ____)) return ______________ else: jscore_rest = jscore(_______, ________) return ______________
Write a function negate_last(n, values)
that takes as inputs
an integer n
and an arbitrary list of integers values
and
that uses recursion to create and return a version of
values
in which only the last occurrence of n
(if any)
has been negated. For example:
>>> negate_last(3, [2, 3, 1, 2, 3, 4]) result: [2, 3, 1, 2, -3, 4]) >>> negate_last(2, [2, 3, 1, 2, 3, 4]) result: [2, 3, 1, -2, 3, 4] >>> negate_last(7, [9, 5, 7, 7, 7]) result: [9, 5, 7, 7, -7]) >>> negate_last(2, [1, 3, 5, 7, 9]) # no occurrences result: [1, 3, 5, 7, 9] >>> negate_last(2, []) result: []
Notes:
When making the recursive call, it will be helpful to take a
different approach than we’ve typically taken when recursively
processing a list. Ask yourself: How could I reduce the
problem in such a way that I could easily find the final
occurrence of n
in values
?
This function – like the rem_first
function – will need
more than one base case. Ask yourself: For what types of cases
can I determine the solution to the problem without needing to
reduce it any further?
To figure out the logic of the function, we strongly encourage you to begin by considering concrete cases. Ask yourself the types of design questions that we have asked in lecture and lab, and use the answers to those questions to determine what the function should do.
Write a function first_occur(elem, seq)
that takes as inputs an
element elem
and a sequence seq
, and that uses recursion
(i.e., that calls itself recursively) to find and return
the index of the first occurrence of elem
in seq
. The sequence
seq
can be either a list or a string. If seq
is a string,
elem
will be a single-character string; if seq
is a list,
elem
can be any value. Don’t forget that the index of the first
element in a sequence is 0.
Important notes:
If elem
is not an element of seq
, the function should return
-1
.
You may not use the in
operator in this
function. In addition, you may not use any built-in function
except the len
function.
Your function must call itself recursively. You must not write a separate helper function to perform the recursion. In addition, using a list comprehension is not allowed.
Here are some examples:
>>> first_occur(5, [4, 10, 5, 3, 7, 5]) result: 2 >>> first_occur('hi', ['well', 'hi', 'there']) result: 1 >>> first_occur('b', 'banana') result: 0 >>> first_occur('a', 'banana') result: 1 >>> first_occur('i', 'team') result: -1 >>> first_occur('hi', ['hello', 111, True]) result: -1 >>> first_occur('a', '') # the empty string result: -1 >>> first_occur(42, []) # the empty list result: -1
Hints:
You will need more than one base case for this function.
To figure out the logic of the function, we strongly encourage you to begin by considering concrete cases. Ask yourself the types of design questions that we have asked in lecture and lab, and use the answers to those questions to determine what the function should do.
When deciding what to do after the recursive call returns, you will need to base your decision on the result of the recursive call.
Login to Gradescope by clicking the link in the left-hand navigation bar, and click on the box for CS 111.
Submit your ps3pr3.py
and ps3pr4.py
files under the assignment
labeled PS 3: Problems 3 and 4 using these steps:
Click on the name of the assignment in the list of assignments. You should see a pop-up window with a box labeled DRAG & DROP. (If you don’t see it, click the Submit or Resubmit button at the bottom of the page.)
Add your files to the box labeled DRAG & DROP. You can either drag and drop the files from their folder into the box, or you can click on the box itself and browse for the files.
Click the Upload button.
You should see a box saying that your submission was successful.
Click the (x)
button to close that box.
The Autograder will perform some tests on your files. Once it is done, check the results to ensure that the tests were passed. If one or more of the tests did not pass, the name of that test will be in red, and there should be a message describing the failure. Based on those messages, make any necessary changes. Feel free to ask a staff member for help.
Note: You will not see a complete Autograder score when you submit. That is because additional tests for at least some of the problems will be run later, after the final deadline for the submission has passed. For such problems, it is important to realize that passing all of the initial tests does not necessarily mean that you will ultimately get full credit on the problem. You should always run your own tests to convince yourself that the logic of your solutions is correct.
If needed, use the Resubmit button at the bottom of the page to resubmit your work. Important: Every time that you make a submission, you should submit all of the files for that Gradescope assignment, even if some of them have not changed since your last submission.
Near the top of the page, click on the box labeled Code. Then click on the name of each file to view its contents. Check to make sure that the files contain the code that you want us to grade.
Important
It is your responsibility to ensure that the correct version of every file is on Gradescope before the final deadline. We will not accept any file after the submission window for a given assignment has closed, so please check your submissions carefully using the steps outlined above.
If you are unable to access Gradescope and there is enough
time to do so, wait an hour or two and then try again. If you
are unable to submit and it is close to the deadline, email
your homework before the deadline to
cs111-staff@cs.bu.edu
Last updated on October 1, 2024.