Kotlinlearncs.online LogoJava
Return to List

Test Writing: Sydney Semester Converter

Created By: Geoffrey Challen
/ Version: 2026.2.0

University semesters in the Southern Hemisphere don't line up with those in the Northern Hemisphere. At the University of Sydney, the academic year starts in February (their late summer), while at US universities it starts in August or September (their late summer).

Create a method called toSydneySemester that accepts a String with a US semester name and returns the equivalent University of Sydney semester name.

Use the following conversions:

  • "Fall""Semester 2" (both are Aug–Dec)
  • "Spring""Semester 1" (both are Feb–Jun)
  • "Summer""Winter Intensive" (US summer = Australian winter)
  • "Winter""Summer Intensive" (US winter = Australian summer)

For any other input, return "Unknown".

Test Design Challenge

You're challenge is to write tests for this problem described above.

  • Provide a method named test that accepts no arguments and does not return a value.
  • If the implementation of the class described above is incorrect, your test method should throw an exception.
  • If it is correct, do not throw an exception.
  • You may want to use Java's assert method

Related Lessons

Stuck? You may find these lessons helpful:

Report a Problem

Attribution must link to this page: https://www.learncs.online/testtesting/java/sydney-semester-converter/[email protected]