CS 222
Programming for Engineers
Summer 2016

Syllabus

The course syllabus is here.

TAs

Graduate teaching assistant:
Al Amin Hosain
email: ahosain_AT_gmu.edu
office hours: Monday 2:00-400 and Friday 10:00-noon in 5321 ENGR
Undergraduate teaching assistant:
Nusha Mehmanesh
email: nmehmane_AT_masonlive.gmu.edu
office hours: Monday and Wednesday 9:00-10:00, Tuesday and Thursday in ENGR 4456 4:00-5:00

Exams

Midterm exam: Thursday, July 14, in regular class time.
   A review sheet for the midterm is here.
Final exam: Friday, July 29, 10:30-1:15.
   A review sheet for the final is here.

GDB stuff

A gdb reference card is here: gdb-refcard.pdf
A quick youtube video is here.

Programming assignments

Program 1 is here.
Program 2 is here.
Program 3 is here.
Program 4 is here.
For your sample terminal session run your Program 4 twice, once with each of the following input files: sample4-1.txt and once with sample4-2.txt.

Resources

C compilers

You should program with the gcc compiler. gcc is available on (virtually) all Unix systems. This includes the mason cluster, Linux, Cygwin (on Windows), and Mac OS X.

On GMU systems you should use zeus. To logon to zeus:

ssh your_gmu_id@zeus.vse.gmu.edu

If you are working on a Windows machine you should get a DOS port of gcc. This, of course, involves using DOS. To do this select Run... from the taskbar and then type cmd. A DOS window will open for you. Working from a command line on DOS is much like using a Unix shell. Google "DOS commands" for information on using DOS. You will need an editor (or an IDE -- see below). Do not use Notepad or a word processor.

A good Windows port of gcc are is MinGW. It can be downloaded here. Follow the link "HOWTO Install the MinGW (GCC) Compiler" to get going.

For Mac OS X users: gcc does not come installed on your Mac. You must install Xcode (an IDE for Mac) -- this will install gcc.

Editors

Emacs is a very powerful and popular editor. It is available on all Unix/Linux systems. Learning Emacs is not particularly easy, but it is worth the effort. When you start Emacs typing ctrl-h t will start a lesson on how to use it. If you get frustrated you can get a session with a psychotherapist by typing alt-x doctor (or esc x doctor). Several tutorials on using Emacs are available on the web (Google "Emacs tutorial"). A Windows port of Emacs can be downloaded from http://ntemacs.sourceforge.net.

jEdit is an editor whose operation is similar to a word processor. It is available from http://www.jedit.org. It runs on all relevant systems. jEdit is easy to learn and complete documentation is available from the jEdit website.

Integrated Development Environments

An integrated development environment (IDE) is a program which provides (or provides access to) a compiler, editor, debugger, and from which you can also run your program. Using an IDE gives you the convenience of being able to do all your programming work from one program rather than having to run several different programs from the command line.

Two IDEs designed for programming in C (or C++) are Dev-C++ and Codeblocks. Each of these can be downloaded with a copy of MinGW. Dev-C++ can be downloaded from http://sourceforge.net/projects/dev-cpp and Code::blocks can be downloaded from http://www.codeblocks.org/.

Note to Dev-C++ users: When you run your program from the IDE a window is opened in which the program runs and then the window closes immediately. This may make it appear that your program did not run completely (or maybe at all). To get around this put this (temporary) line at the end of main:

system("PAUSE");
The window will now stay open until you hit any key.