Multi-File Programs

Note:  Please keep the programs that you create today, in case you have a dispute about your grades for the ICEs at the end of the quarter. When you're working with a partner, each person should save their own, individual copy

 

Part  1: Multi-File Programs: Putting Classes In Separate Files

            First, go through the Harvester example, and figure out why the robot is crashing, and then implement easy fixes to prevent that and make sure that the robot picks up ALL things in the city.

 

            Second, you too can put different classes into separate files.  Take a program that you’ve worked with (such as an in-class exercise), and separate the robot class into its own, separate file.  Make sure that the whole program still compiles, and that it runs and does everything the same as in your original version.

 

Part  2: Multi-File Programs: A Quick Exercise

           

            Download the two starter files for the Standard version of A4 (the guessing game program).  Make sure that you can compile and run the program as it is provided to you.

            Next, modify the PlayGuessingGame method, in the GuessingGame file, so that it does something different.  It doesn't matter what – you just want to change it, recompile it, and verify that you can re-run the program and see these new results.  Having it do something like printing out a new/changed message would be a good choice.