1 of 9

Recap: Structure

  • This assignment structure is different from previous assignments
  • You write programs, not methods, and you read input files yourself + write to a file (names specified via args)
    • Read the description to know what we expect
  • You can create your own classes and use classes in java.util.* (ex: ArrayList, Queue, HashMap)
  • Submit a ZIP file - we expect that it matches the file structure provided to you
    • Directions on description are for people using a unix-based system; use WinZip or other software on Windows

NeighborhoodMap

FindTreatsRoute

FindHouseWithMostCandy

PathToMostCandy

ShortestPath

Other classes you write to support your programs + StdIn/StdOut

CanAvoidCurfew

Mini-tasks (complete before starting this)

2 of 9

Getting Started

  • Open the TrickOrTreat folder in VS Code (the one that directly contains the bin, src and lib folders), using File -> Open Folder
  • What NOT to do: →

3 of 9

Using the Debugger

  • It’s slightly different to use the debugger because we have to work with command line args
  • If you hit “Run” in VS Code without doing anything, we’ll get: Too few arguments. Did you put in command line arguments? If using the debugger, add args to launch.json.

4 of 9

Using the Debugger

  • Hit the “Run and Debug” button on the left side:
  • Create a launch.json file:

  • Scroll to where you see a JSON entry for “args” and add a new field with the args needed, space-separated and enclosed in quotes:
    • Put a comma after the last quote in projectName
    • Then: “args”: “input1.in input1.out” on a new line (example)
  • When running, right click the file (ex: NeighborhoodMap.java) and select “Run Java” or “Debug Java”). Don’t hit Current File

5 of 9

How to Submit (on Mac)

  • Zip the TrickOrTreat folder to an archive named TrickOrTreat.zip. In VS Code:
    • cd .. to go to the parent directory
    • zip -r TrickOrTreat.zip TrickOrTreat
    • To check your zip file: while still in parent dir, unzip -l TrickOrTreat.zip
    • THESE COMMANDS WILL NOT WORK ON WINDOWS

6 of 9

How to Submit (on Windows)

  • Use a program like WinZip to zip the innermost TrickOrTreat (case sensitive) folder to a file named TrickOrTreat.zip
    • Check your zip file before submitting: it should be named TrickOrTreat.zip (case-sensitive).
  • If using Windows “send to -> compressed zip”, zip the innermost TrickOrTreat folder to a zip file named TrickOrTreat.zip

Don’t zip A5 (or an outer TrickOrTreat!)

7 of 9

Common Mistakes

  • Don’t zip only the “src” directory
  • Don’t zip only the “trick” package directory inside src
  • Don’t zip an outer “TrickOrTreat” or “CS112 Class Code” directory
  • Don’t zip/submit a single file (like NeighborhoodMap.java).
  • Don’t try to submit your mini-tasks separately

8 of 9

How to Submit

  • Unzip before you submit. Your code should be accessible from TrickOrTreat/src/trick when unzipping
    • This should be TrickOrTreat. Not “trickortreat”, “Trick Or Treat”, “Trick or Treat Copy”, “A5”, etc.
  • Make sure you aren’t trying to submit the provided zip file
  • Be sure to double check
    • We can’t make exceptions, extend due dates, or remove submissions if your zip is incorrect
    • Don’t submit last minute - there will be no time to fix issues, and we can’t fix for you
    • Remember that your latest submission counts

9 of 9

Troubleshooting Submission Issues

  • If your ZIP structure is incorrect you will receive the following hint:
    • The autograder encountered an error. Please seek assistance from an instructor and/or the help system.
  • How to check? Go to your version page and select netid@rutgers.edu_#_trickortreat.zip
  • Then, look at the files in the archive: your code should be accessible from TrickOrTreat/src/trick (see right)
    • In this case, we zipped an Assignments folder instead