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)

  1. Make sure you have JDK and your Java IDE of choice available (see Resources for details).

  2. Proceed with the GitHub quiz on Brightspace: read its description, and submit the answer.

  3. [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.

  4. 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 sum against it. You can push again before the deadline; the last push is the one that counts.

What else to do (optional part)

These problems are ungraded: they carry no points, and skipping them costs you nothing.

  1. [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.

  2. [Consulting AI allowed] How much shorter can you make the signature of the main function in your code with the version of Java you have on your computer?

  3. [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 sum function is doing its job and be silent about this property unless it breaks.
  4. 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).
  5. 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 sum function for both programs.

  6. If the maximum in the previous problem is computed with a for loop, try to update the program to avoid this for loop in the same way as you did for sum.