part I due by 10 p.m. on Wednesday, July 16, 2025
part II due by 10 p.m. on Friday, July 18, 2025
In your work on this assignment, make sure to abide by the policies on academic conduct for this course.
If you have questions while working on this assignment, please come to
office hours, post them on Ed Discussion, or email
cscis111-staff@lists.fas.harvard.edu
50 points total
Create a subfolder called ps5
within your
s111
folder, and put all of the files for this assignment in that
folder.
The problems from Part I will all 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
ps5_partI
.
Add your work for the problems from Part I to this file.
Once you have completed all of these problems, choose
File->Download->PDF document, and save the PDF file on your
machine. The resulting PDF file (ps5_partI.pdf
) is the one that
you will submit. See the submission guidelines at the end of Part I.
Rectangle
class revisited11 points total; individual-only
Recall the Rectangle
class that we defined in lecture. (The final
version of this class is available
here.)
Consider a potential instance method named tallerThanWide
that would
return true
if a Rectangle
object has a height that is larger
than its width, and false
otherwise.
tallerThanWide
be,
an accessor or mutator?Now consider a potential instance method named adjust
that
would take two integers specifying a width and height and adjust
the dimensions of a Rectangle
as needed so that its
dimensions are at least as big as the ones specified by the
parameters. For example, if a Rectangle
‘s dimensions
are 100 x 50, then calling the adjust
method with
parameters of 80 and 70 would leave the Rectangle
‘s
width alone (because 100 is already greater than 80), but change
its height to 70 (because 50 is smaller than 70).
adjust
be,
an accessor or mutator?Consider the following client code — i.e., code from another
class that uses a Rectangle
object:
Rectangle r1 = new Rectangle(30, 50, 100, 25); System.out.println(r1); r1.height = r1.height * 2; System.out.println(r1.width + " x " + r1.height);
Because our Rectangle
class employs appropriate encapsulation,
this code fragment will not compile.
9 points total; individual-only
Recall the RectangleClient
class that we defined in lecture. (The
final version of this class is available here.)
(5 points) In the provided RectangleClient
, all of the client
code is inside of the main
method. However, client code
can also include static methods that take one or more
objects of the relevant class as a parameter.
Write a static method called largerThan
that takes two
Rectangle
objects r1
and r2
as parameters. The method should
return true
if r1
has a larger area than r2
, and false
otherwise.
For example, given the following two Rectangle
objects:
Rectangle r1 = new Rectangle(20, 6); Rectangle r2 = new Rectangle(25, 4);
the call largerThan(r1, r2)
should return true
, but the call
largerThan(r2, r1)
should return false
.
Notes:
The method must be written as client code – i.e., it should
work correctly if it is added to a class other than the
Rectangle
class itself.
For full credit, your method should take advantage of the
non-static methods that are inside every Rectangle
object
so that the method doesn’t need to do too much work on its
own.
To test your method, you could either download our
RectangleClient
class (see above) or create a new client
class of your own. Add your method to the class, and then
add some test code for it to a main
method.
Once you are satisfied that your method works correctly,
add it to your ps5_partI
file.
(4 points) In ps5_partI
, write client code for the Rectangle
class that does the following:
Creates a Rectangle
object with a position of (0, 0),
a width of 40, and a height of 50, and assigns it to a
variable r
. (Note: Since the position is (0, 0), you
should take advantage of the constructor that assumes
that both the x
and y
values are 0.)
Prints the dimensions of r
– taking advantage of the
way that the provided toString()
method works.
Uses the grow
method to increase the width of r
by 5 and
the height of r
by 12.
Prints the new dimensions of r
– taking advantage of the
way that the provided toString()
method works.
If your client code works correctly, its output should be:
40 x 50 45 x 62
6 points total; 3 points each part; individual-only
When designing a blueprint class, we can include both non-static and static methods. A non-static method is required if the method must have access to the fields of a particular called object. However, if a method does not need a called object – i.e., if all of the information that it needs is supplied by its parameters – then we typically make it static. Non-static methods must be called on an object of the class. Static methods may be called on an object of the class, but it is better style to call them using the name of the class instead.
Imagine that you have a Grade
class that serves as a blueprint class
for objects that represent a student’s grade on a given assignment or test.
Each Grade
object encapsulates both the raw score and the late penalty
(if any) associated with the grade. Assume that you are considering
adding two methods to this class.
The first method is called computeRaw
. It takes two parameters
— a double
called pct
and an int
called possiblePoints
—
and it computes and returns the raw score that would be obtained
if a student earned pct
percent of the points represented by
possiblePoints
. In other words, it converts a percentage grade
to a raw score. For example, if pct
is 80.0 and possiblePoints
is 50, the method should return 40.0, because 40 is 80 percent of 50.
computeRaw
be — static or
non-static? Explain briefly.Grade
class. If you need a Grade
object to
call the method, assume that the variable g
represents
that object, and that the object has already been created.The second method is called waiveLatePenalty
. It takes no
parameters, and it sets the late penalty of a Grade
object to 0.
waiveLatePenalty
be — static or
non-static? Explain briefly.Grade
class. If you need a Grade
object to
call the method, assume that the variable g
represents
that object.8 points total; individual-only
Recall the set of vehicle classes that we defined in lecture. Although we
discussed the possibility of a Limousine
class (and included it in
some of the inheritance-hierarchy diagrams in the lecture notes) we
never actually defined this class. In this problem, you will write a
definition for this class that takes full advantage of inheritance.
A Limousine
object should have all of the same state and behavior
as an Automobile
object. In addition, it should maintain additional
state that keeps track of:
You should assume that a limousine is not an SUV.
When a Limousine
object is printed, we should see its make, its
model, and the number of seats available to customers, which is
two fewer than the total number of seats. For example, if
the Limousine
is a Cadillac XTS-L with a total of 8 seats, printing
it should produce the following output:
Cadillac XTS-L (seats up to 6 customers)
Note that the output mentions 6 seats, because only 6 of the 8 seats are available for customers.
In your ps5_partI
file, add a definition of this class that includes
the following:
Limousine
object. Make sure that you take inheritance
into account when deciding which fields to include.6 points total; 2 points each part; individual-only
Consider again our set of vehicle classes. Which of the following assignments are valid, and which are not? Explain each answer briefly.
Object o = new Automobile("Cadillac", "El Dorado", 2015);
TractorTrailer t = new Truck("Mack", "BigOne", 2007, 12);
Vehicle v = new Taxi("Ford", "Tempo", 1997, "1234");
10 points total; 2 points each part; individual-only
Consider the following four classes:
public class Woo extends Zoo { public String one() { return "wee" + this.two(); } public String extra() { return "eek" + this.one(); } } public class Zoo { public String one() { return "zee"; } public String two() { return "zow"; } } public class Too extends Zoo { public String two() { return "tow" + this.one(); } public String extra() { return "teek" + this.two(); } } public class Yoo extends Woo { public String two() { return "yow"; } }
Assume that you have the following variable declarations, all of which are valid:
Woo w = new Woo(); Zoo z = new Woo(); Too t = new Too(); Woo y1 = new Yoo(); Yoo y2 = new Yoo();
Consider the following statements. If a given statement would compile, state the output that it would produce when it is executed. If a given statement would not compile, explain why.
System.out.println(w.one() + " " + w.two() + " " + w.extra());
System.out.println(z.one() + " " + z.two() + " " + z.extra());
System.out.println(t.one() + " " + t.two() + " " + t.extra());
System.out.println(y1.one() + " " + y1.two() + " " + y1.extra());
System.out.println(y2.one() + " " + y2.two() + " " + y2.extra());
Submit your ps5_partI.pdf
file by taking the following 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 on your machine.
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.
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
cscis111-staff@lists.fas.harvard.edu
50 points total
There are no grad-credit problems for this assignment.
In this part of the assignment, you will be creating blueprint classes for a card game called Huno. You can think of it as Harvard’s version of a popular card game whose name does not begin with H!
Card
objects20 points; pair-optional
Important
On this and all of the remaining Part IIs, make sure to employ
good programming style. Use appropriate indentation, select
descriptive variable names, insert blank lines between logical
parts of your program, and use comments at the top of each file
and before each method other than main()
. See the coding
conventions for more detail.
In this problem, you will create a class called Card
that serves as a
blueprint for objects that can be used to represent a single playing
card in Huno.
(0 points) Download Card.java
into your ps5
folder
and open it in VS Code.
This file includes some starter code for the class you will write. We encourage you to read through this code before continuing — including all of the comments that we have provided. In particular, make sure that you understand the following class constants:
integer constants for the minimum and miximum values that a
Card
can have
an array of strings called COLORS
that lists the names of
all of the colors that a Card
can have in Huno
Implement the isValidColor
method (3 points)
Complete the isValidColor
method provided in Card.java
. This
method takes the name of a color as a parameter, and it should
return true
if the specified color is valid (i.e., if it is one
of the colors listed in the COLORS
array), and false
otherwise. For example:
isValidColor("red")
should return true
, because “red” appears
in the COLORS
arrayisValidColor("orange")
should return false
, because “orange”
does not appear in the COLORS
array.Notes:
isValidColor("Red")
should return false
, because "Red"
begins with an upper-case R
, and the version in the COLORS
array begins with a lower-case r
. for
loop to process the elements of the COLORS
array, looking for a match. Doing so will allow your code to
adapt if we add more colors to the COLORS
array.
If you can’t figure out how to use
a loop, it’s worth noting that the approach you will need to
take is similar to the approach taken by the schoolNumber
method from problem 2 in Problem Set 4. Define the fields (2 points)
Each Card
object should encapsulate two pieces of state:
String
)For example, here is what a Card
object representing a red 7
would look like in memory:
(To simplify matters, we have shown the string “red” inside the field, even though in reality the memory address of the string would be stored.)
For now, you only need to define the fields. Make sure to:
use the field names shown above
protect them from direct access by client code.
In subsequent sections, you will write constructors that assign values to the fields, and that ensure that only valid values are allowed.
Implement mutators for the fields (4 points)
Next, add the following mutator methods:
setColor
, which takes a String
representing a color
and sets the value of the Card
object’s color
field to
the specified color. Attempts to assign an invalid color should
produce an IllegalArgumentException
. Take advantage of your
isValidColor
method when checking for invalid colors.
setValue
, which takes an integer and sets the value of the
Card
object’s value
field to the specified
number. Attempts to assign an invalid value (one that is
outside the range specified by the MIN_VALUE
and MAX_VALUE
constants) should produce an IllegalArgumentException
.
Make sure that your methods are non-static, because they need access to the fields in the called object.
Implement a constructor (2 points)
Next, add a constructor that takes a string for the Card
‘s color
and an integer for the Card
‘s value (in that order), and
initializes the values of the fields. Your constructor should call
the mutators that you defined in part 3 so that you can take
advantage of the error-checking code that is already present in
those methods.
Implement accessors for the fields (2 points)
Next, define the following accessor methods:
getColor
, which returns the string representing the Card
object’s color.getValue
, which returns the integer representing the
Card
object’s value.Make sure that your methods are non-static, because they need access to the fields in the called object.
Once you have completed parts 1–6, you can test them using the first client program that we’ve given you. See below for more detail.
Define the toString
method (2 points)
Write a toString
method that returns a String
representation of
the Card
object that can be used when printing it or concatenating
it to a String
. We discuss this type of method in the lecture
notes, and we provide an example in our Rectangle
class. The
returned String
should be of the form color value
(e.g.,
"blue 3"
or "red 10"
).
Define methods for comparing Card
objects (4 points)
Finally, define the following two instance methods for
comparing Card
objects:
matches
, which takes another Card
object as a parameter and
returns true
if the called Card
object matches the color
and/or value of the other Card
object, and false
if it
doesn’t match either the color or the value. If a value of null
is passed in for the parameter, the method should return false
.
equals
, which takes another Card
object as a parameter and
determines if it is equivalent to the called object, returning
true
if it is equivalent and false
if it is not equivalent.
Two Card
objects should be considered equivalent if their color
and value are the same. If a value of null
is passed in for
the parameter, the method should return false
.
Client programs and testing your code
To help you in testing your Card
class, we have created two sample
client programs that you should download into your ps5
folder:
Make sure to put these client programs in your ps5
folder, and
don’t open them until the necessary parts have been completed.
In addition to using the client programs, we recommend that you perform
additional testing on your own. You can do so
by adding code to one of the clients, or by adding a main
method to
the Card
class.
Note: The static isValidColor()
method from part 2 is not directly
tested by the clients. However, it should be tested indirectly by
Client 1, because it should be called by one or more of the other
methods that you write. If you wanted to test it
directly, you could either add a main
method to your Card
class and
put some test code for it in that method, or you could temporarily
change it from private to public so that you can test it from the
Interactions Pane. (Private methods cannot be tested from the
Interactions Pane, because they can only be called from inside the
class.)
If you are unable to get a given method to compile, make sure to comment out the body of the method (keeping the method header and possibly a dummy return value) so that we’ll still be able to test your other methods.
30 points; individual-only
Overview
In this problem, you will finish your implementation of Huno.
The version of the game that you will complete
allows a single human player (the user) to compete against a
single computer player.
Rules of the game
Huno cards have a color (blue, green, red, or yellow) and a value
between 0 and 9. At the start of the game, each player is dealt a hand
of five cards, and a single card is turned over to form the beginning
of a discard pile.
Players take turns attempting to discard a single card from their hands. The card to be discarded must match either the color or the value of the card at the top of the discard pile. For example, if the card at the top of the discard pile is a blue 3, a player could play a blue card of any value, or a 3 card of any color. If a player has no cards that match the top of the discard pile, he or she must draw a card and wait until his or her next turn.
The game continues until a player has no cards left or until a player accumulates 10 cards. At the end of the game, the player whose final hand has the smallest total value wins the game and earns the total value of the other players’ final hands. To reduce the likelihood of a player winning with 10 cards, a penalty of 25 points is added to the value of any hand with 10 cards. If there is a tie (two or more players with hands that have the same smallest final value), no one wins any points.
For example, let’s say that there are two players and one of them accumulates 10 cards, ending the game. Assume that the final hands of the players are:
Player 1 ends up with the final hand with the smallest total value (2+3+1 = 6) and thus wins the game. Player 2’s final hand value is 3+1+2+2+1+3+1+0+1+3 = 17, plus the added 25-point penalty, to give 42. Player 1 earns 42 points.
Because the player with the smallest total value wins, players have an incentive to discard cards with a high value.
Sample runs
The version of the game that you will implement will allow a human
player to play against the computer. Here are some sample runs of the
game:
Notes about the sample runs:
Structure of the program
The code for your Huno program will be divided into a number of
different classes. In particular, you will use the Card
class that you
wrote for the previous problem.
In addition, we are giving you complete or nearly complete implementations of the following classes:
Deck.java
This class is a blueprint for objects that represent a
deck of Huno cards. These objects have several methods,
the most useful of which are the shuffle
and dealCard
methods. It uses a random-number generator when shuffling the
cards to get a different ordering of the deck each time.
When testing your code, it’s possible to control the
numbers generated by the random-number generator so that you
can get repeatable hands of cards. See the section
entitled Suggested approach for more details.
You should not modify the code in this class.
Huno.java
This class contains the main
method of the
program; you will run this class to start the program.
In addition, this class serves as a blueprint for objects that
maintain the state of a Huno game. It includes fields
for things like the deck, the players, and the card
at the top of the discard pile, and it includes methods
that are used to execute the various stages of the game.
You should not make any modifications to this
class except for the single change specified in Task 3.
Download these files, making sure to store them in your ps5
folder
– the same folder in which you stored your Card.java
file.
Task 1: review the provided code
Begin by reading over the code that we have given you. In particular,
you should look at how the Huno
class will make use of the types
of objects that you will create below. You do not need to fully
understand how the Deck
class works, but we encourage you to look it
over.
Task 2: create a blueprint class for a player
Write a class named Player
that serves as a blueprint for objects
that represent a single Huno player. Save it in the same folder as
the classes that you downloaded above. Import the java.util
package at
the start of the file.
Each Player
object should have the following components:
three fields:
name
to keep track of the player’s name (a single
string)hand
for an array to hold the cards
in the player’s handnumCards
to keep track of how many cards are
currently in the player’s hand
Make sure that your field definitions
prevent direct access by code from outside the class.a constructor that takes a single parameter for the name of the
player. It should initialize all of the fields. Among other things,
it should create the array that will store the cards. Make the
collection big enough to store the maximum number of cards in a
given hand (10). Use the class constant Huno.MAX_CARDS
to
specify this value, rather than hard-coding the integer 10.
an accessor named getName
that returns the player’s name.
an accessor named getNumCards
that returns the current number of
cards in the player’s hand.
a toString
method that just returns the player’s name.
a mutator named addCardToHand
that takes a Card
object as a
parameter and adds the specified card to the player’s hand,
filling the array from left to right. It should throw an
IllegalArgumentException
if the parameter is null
, or if the
player already has the maximum number of cards.
an accessor named getCardFromHand
that takes an integer index as
a parameter and returns the Card
at the specified position in
the player’s hand, without actually removing the card from the
hand. For example, if p
is a Player
, p.getCardFromHand(0)
should return the card at position 0 in p
‘s hand – i.e., the
first/leftmost card. If the specified index does not correspond
to one of the cards in the hand, the method should throw an
IllegalArgumentException
.
an accessor method named getHandValue
that computes and returns
the total value of the player’s current hand – i.e., the sum of
the values of the individual cards, plus an additional 25-point
penalty if the hand has the maximum number of cards. Use the class
constants given in Huno.java
for the maximum number of cards and
for the penalty associated with having that many cards.
an accessor method named printHand
that prints the
current contents of the player’s hand, preceded by a heading
that includes the player’s name. Each card should be printed
on a separate line, preceded by the index of its position
in the hand. For example:
John's hand: 0: red 7 1: green 2 2: blue 3
See the sample runs for additional examples. Note that the spacing matters. In particular, there should be:
a mutator method named removeCardFromHand
that takes
an integer index as a parameter and both removes and returns
the Card
at that position of the player’s hand.
If the specified index does not correspond to one of the cards in
the hand, the method should throw an IndexOutOfBoundsException
.
If the card being removed is not the rightmost card in the hand,
the rightmost card must be moved into the position of the card
that is being removed. For example, if the hand is currently the
four cards {blue 3, red 2, yellow 7, green 1}
and you are
removing the card at position 1 (the red 2
), you must replace
it with the last card (the green 1
), and thus the resulting hand
would be: {blue 3, green 1, yellow 7}
.
an accessor method named getPlay
that determines and returns
the number corresponding to the player’s next play: either
-1 if the player wants to draw a card, or the number/index
of the card that the player wants to discard from his/her hand.
The method should take two parameters: a Scanner
object that can be used to read from the console,
and a Card
object representing the
card that is currently at the top of the discard pile.
The method should print the appropriate prompt and read an integer from the console. If the number entered is invalid (i.e., if it is neither -1 nor an index of one of the cards in the hand), the method should continue asking for a new value until the player enters a valid one.
You do not need to worry about whether the
specified card matches the top of the discard pile,
because the code that we have given you in the Huno
class already checks for that.
You may assume that the player never enters a non-integer.
Because this version of the method is for a human player, it can ignore the second parameter (the card at the top of the discard pile). The version of this method that you will write in Task 3 will be for a computer user, and it will use the second parameter.
After completing all of Task 2, you should be able to open and compile
the Huno
class, and run it to play the game. At this point, the
computer will be represented by a Player
object, which means that you
will be able to see the contents of its hand, and that its plays will
be determined using the getPlay
method that
you implemented above. In other words, you will need to
enter the plays for both players.
If the Huno
class doesn’t compile, that probably means that there
are problems in the headers of one or more of your Player
methods.
Change your Player
class as needed until the Huno
class
compiles. Remember that you are not allowed to change the
Deck
class in any way. In addition, you should not change the
Huno
class at this point in the process.
When running the program, you should highlight Huno.java
in the
list of files before using F5 to run the program. Another option is
to right-click on the name of the file in the Explorer pane and choose
Run or Run Java.
Task 3: create a blueprint class for a computer player
The Player
class that you wrote for Task 3 serves
as a blueprint for the human player — since its getPlay
method asks the user of the program to enter the next play from
the console. In this task, you will write a class named
ComputerPlayer
that serves as a
blueprint for objects that represent a computer player.
Save it in the same folder as your other classes for this program.
Import the java.util
package at the start of the file.
Most of the state and behavior needed for a ComputerPlayer
is already present in Player
. Thus, you should
make ComputerPlayer
a subclass of Player
,
so that it will inherit the fields and methods of that class.
In addition to the inherited fields and methods, this class will need:
its own constructor, which should take the name of the player as a parameter and call the constructor of the superclass to do the actual work of initializing the inherited fields.
a printHand
method that overrides the inherited
version of that method. This version of the method should
simply print the number of cards in the
ComputerPlayer
‘s hand. For example:
the computer's hand: 3 cards
"the computer"
)."card"
instead
of "cards"
.name
field.
Instead, it should make use of the appropriate
accessor methods to get the name and the number of cards.a getPlay
method that overrides the inherited
version of that method. This version of the method should
figure out if the computer has a card that matches the
card at the top of the discard pile (this card is passed in as
the second parameter of the method). If the computer
doesn’t have a matching
card, the method should return -1 so that the computer will end up
drawing a card. If the computer does have one or more matching cards,
the method should return the index of the card that should
be played.
Once you have defined your ComputerPlayer
class, modify the line of
code in the Huno
constructor that assigns a value to the second
element of the players
array (players[1]
). Instead of assigning a
Player
object, it should now assign a ComputerPlayer
object. You should not make any other changes to the Huno
class.
If you have implemented everything correctly, the computer’s hand should now be hidden when you run the program, and the computer should determine its own play, rather than asking you to enter it from the keyboard.
Once all of these tasks are completed, you should have a working Huno game!
Testing your code
To get repeatable hands for testing purposes, you can specify a seed
for the random-number generator used by the Deck
class when it
shuffles the deck. Here is one way to do so:
As needed, open the folder containing your code by using the File->Open Folder or File->Open menu option in VS Code.
If you don’t already have a Terminal pane at the bottom of the VS Code window, use the Terminal->New Terminal menu option to open one.
Enter the following command from the Terminal to compile your code:
javac Huno.java
If executing this command produces error messages describing bugs in your code, fix them, save the file(s) in VS Code, and try again. Repeat this process until your code compiles without any error messages.
Enter the following command from the Terminal to run your code with a random seed:
java Huno seed
where you replace seed
with an integer.
Other testing notes
If you make any changes to your code, make sure to:
Save the changed file(s) in VS Code.
Recompile your code by executing
javac Huno.java
before you attempt to rerun the program.
To make sure that the getPlay
method in your ComputerPlayer
class is working correctly, you may want to temporarily comment
out the displayHand
method in that class. Doing so will cause
all of the dealer’s cards to be displayed, which will allow you to
see if getPlay
is selecting the correct card. Make sure to
uncomment displayHand
before submitting the file.
Important
If you chose to work on Problem 7 with a partner, both you and your partner should submit your own copy of your joint work, along with your individual work on Problem 8.
You should submit only the following files:
Card.java
Huno.java
Player.java
ComputerPlayer.java
Here are the 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 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 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 you see 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
cscis111-staff@lists.fas.harvard.edu
Last updated on July 14, 2025.