PIC 10a

Email: jjacobson@math.ucla.edu
Office hours: PIC lab, Tuesdays 3-4pm, Thursdays 2:30-3:30pm.

Midterm Review

Todd Wittman's website has a bunch of old exams to review.

Example programs

I will be posting the examples from section on this website.

Building graphics programs on a Mac

NOTE: If you already downloaded the Mac graphics files for HW3, you should download them again for this assignment. I've fixed some bugs and changed their names to be more compatible with the Windows versions.

Instructions and relevant files are here.

Building C++ programs on a Mac

Here are some basic instructions on how to build and run C++ programs on a Mac. If you run into problems, come by my office hours or send me an email.

The equivalent to Visual Studio on a Mac is called XCode. This is an official Apple program which is distributed with all versions of Mac OS X. If it's not already on your machine, you can install it from the DVD or CD that came with your computer; it may be on a separate CD called "Developer Tools". Alternately, you can download it from Apple's website; they require you to register, but it's free.

Once you have it, open XCode, and do the following:
  1. From the "File" menu, select "New Project". Select "Command Line Tool" and make it of type "C++" (it may be labelled "stdc++").
  2. Click "Choose...", give your project a name and save it somewhere.
  3. The project window will open, and you should see a list of files including "main.cpp". Click it to get the file contents which you can write your assignment in. If you see "main.c" instead: click it once, select "Rename" from the Project menu, and rename it to "main.cpp".
  4. To run your assignment, choose "Build and run" from the "Build" menu (or click the icon in the window, if there is one). Then choose "Console" from the "Run" menu to see your program's output.