Assignment 1 — Setup
Java, IDE, Git, GitHub, Classroom50
Due Sep 1, 2026
Note: “AI” below means your favorite chatbot, e.g. Google Gemini, Microsoft Copilot, ChatGPT. Where a step does not say otherwise, AI tools are not allowed, as set out in the AI policy in the syllabus.
What to do (main part)
Make sure you have JDK and your Java IDE of choice available (see Resources for details).
Proceed with the GitHub quiz on Brightspace: read its description, and submit the answer.
[Most challenging, don’t hesitate to ask] [Consulting AI allowed] Setup GitHub access via SSH keys on your computer. To verify, run
ssh -T git@github.com; it should greet you by your GitHub username. More details on a separate resource page: Crash course in Git.Clone the class starter repo (link on Discord,
#announcements), solve the main task (sum), commit and push to GitHub, which is equivalent to submitting the main part of the assignment.- Your push is picked up by the Classroom50 autograder, which runs the tests for
sumagainst it. You can push again before the deadline; the last push is the one that counts.
- Your push is picked up by the Classroom50 autograder, which runs the tests for
What else to do (optional part)
These problems are ungraded: they carry no points, and skipping them costs you nothing.
[Consulting AI allowed] Can you write your solution without using the
for-loop construct? Try to make AI explain the code to the point you actually understand it.[Consulting AI allowed] How much shorter can you make the signature of the
mainfunction in your code with the version of Java you have on your computer?[Consulting AI allowed but try to moderate the amount of setup for the solution] Add several automated tests for your code exercising corner cases (empty array, one element) as well as a generic case.
- Automated here means that on every run of the program the program should check that the
sumfunction is doing its job and be silent about this property unless it breaks.
- Automated here means that on every run of the program the program should check that the
Extend your program so that if the user enters a non-numeric value, the program terminates gracefully, including an error message explaining the problem.
- After you’re done, discuss with AI how to improve your approach to error handling, including how to format the error message according to modern standards (but again moderate the resulting complexity).
Add a new class whose program, when it starts, shows the user a prompt with a choice of two options: compute the sum of the numbers, or compute the maximum.
Add a new class rather than changing the old one: the old class should work as before for the Classroom50 autograder to be happy.
Ideally, you would reuse the
sumfunction for both programs.
If the maximum in the previous problem is computed with a
forloop, try to update the program to avoid thisforloop in the same way as you did forsum.