C and UNIX (for non-majors)
Spring Quarter 2008 and after
Instructor: Mark S. Hutchenreuther
See academic home page for additional information, such as office and hours.
Meeting Time and Rooms
This class consists only of a lecture. See academic home page for meeting time and room.
Classes and office hours will not be held on holidays. See main academic page for office location and hours.
Prerequisites
There are no prerequisites for this course. Physics, algebra, and trigonometry at the high school or college level are highly recommended.|
Class Schedule |
|||
|
Week |
Lecture |
Topic |
Reading |
|
1 |
0 1 2 |
Ch. 1 and 2 -- Computer Systems HW 1 — Orientation, header files Pro 1 — None this week |
UNIX, Ch. 1 and 3. Text, Ch. 1, 2.1-2.4 |
|
2 |
3 4 |
Ch. 2 and 3 -- Data,
C Programming, Arithmetic Quiz 1 -- Data HW 2 — Computation, Simple Function Pro 2 — Simple Computation with Function |
Text, Ch. 2.5, 2.8, 3.1-3.3 |
|
3 |
5 6 |
Ch. 4 -- Selection
Structures: if and switch Statements Quiz 2 -- Branching HW 3 — Selective Execution, if and switch Pro 3 — Another Example of Selective Execution, if |
Text, Ch. 4 |
|
4 |
7 8 |
Ch. 5 -- Repetition
and Loop Statements Quiz 3 -- Looping HW 4 — Repetitive Execution, while and for Pro 4 —Another Example of Repetitive Execution |
Text, Ch. 5 |
|
5 |
9 10 |
Review for the Mid-Term Examination. |
No reading, lots of rereading |
|
6 |
11 12 |
Ch. 3 and 6 -- More Functions and Pointers |
Text, Ch. 3.4-3.5, 6.1-6.4, 13.7, 14.1 |
|
7 |
13 14 |
TBD |
TBD |
|
8 |
15 16 |
Ch. 8 and 11 -- Arrays and Structures |
Text, Ch. 8.1-8.7, 11.1-11.2 |
|
9 |
17 18 |
Ch. 9 and 12 -- Strings and Files |
Text, Ch. 9.1-9.6, 12.1 |
| 10 | 19 20 Sample |
Loose Ends |
No reading, lots of rereading |
|
Finals |
Final Examination in the Lecture Classroom |
||
|
Topics and reading assignments are subject to revision, examination dates are fixed |
|||
Course Purpose and Goals
To learn the syntax and advanced features of C.
To be able to write programs.
To be able to use the UNIX shell and a subset of UNIX commands.
Textbooks and Materials
The textbooks for the course are Problem Solving & Program Design in C, Hanly and Koffman, any edition, Addison-Wesley, and Hutch’s Handouts and Homework for CSC-234 — C and UNIX, 5th Revision, available at El Corral bookstore.
You will be given a CSC account to allow access to any computer in any of our labs (235, 255, 257, 302, 302, and 303) and our file servers, as well as a 200-sheet limit on our printers. Your user name is the same as your e-mail user name (and also the one you use to access My Cal Poly), which is typically your first initial of your first name and up to seven letters of your last name (e.g., I am
mhutchen).You may need a flash drive to hold your source files. I encourage you to use your CSC vogon UNIX account as a storage area for these files, and to use the ssh ftp client to copy them to the local hard disk where you are currently working.
About Windows Integrated Development Environments (IDEs)
This is a course about C and UNIX, so the idea is that you will be editing programs with the infamous vi editor and compiling with the UNIX gcc command. It is possible to install other packages on your home computer (all but Visual Studio are free) and use that, however, you will still be expected to learn basic UNIX. The one thing you will need is the ssh secure shell telnet and ftp clients available from the My Cal Poly Technology Software page. You might also want to get the Crimson editor (free).
Programs that do C++ also do C and include:
Microsoft Visual Studio, and particularly Visual C++ (available in the bookstore and elsewhere)
Borland C++ Builder
Silverfrost Plato (designed for Fortran, but includes C and C++)
Bloodshed Software Dev-C++
SoftIntegration Ch IDE (allegedly also a C and C++ interpreter)
If You Have A Mac
You can actually complete the course on your Mac. Through a Terminal window, you can access your gcc compiler and editors, compile and run your programs, and also use ssh telnet to log onto our vogon server. You will probably need to get the Fugu secure ftp client, available from the My Cal Poly Technology Software page.
Basically, you need to install or activate X Code on your Mac. The programs you will need to run are:
gcc to compile
script to create script files
vi, emacs, nano/pico, or other editor
If You Have A Linux Computer
Same as with a Mac, you can do the whole course on your computer. Again, the primary application you will use is Terminal to access gcc and possibly an editor, compile and run your programs, and ssh to vogon if needed.
The programs you will need to use are:
gcc to compile
script to create script files
vi, emacs, nano/pico, or other editor
Grade Basis
Your course grade will be based on several components:
| Lecture Quizzes | 20% | ![]() |
| Lecture Midterm Exam | 20% | |
| Lecture Final Exam | 25% | |
| Homework Assignments | 15% | |
| Homework Projects | 10% | |
| Final Programming Project | 10% |
Note that the lowest quiz score will be dropped automatically. The final will be comprehensive but will concentrate on material covered since the midterm. The instructor reserves the right to change the weight of any component by up to 5% and to grade on a curve, which means shifting the grades up if the overall class average is sufficiently low. DO NOT depend on this to get you a decent grade.
|
|
Do Not Bring Food Or Beverages Into Any Computer Lab! Please enjoy your drinks and snacks outside the computer lab. Spilled beverages are fatal to computer keyboards and not very nice to textbooks and notes. Crumbs are especially hard on both keyboards and mice. I will have an area within the lab where food and drink can be kept and enjoyed, an amnesty area away from the computers. Thank you! |
Programming Issues
There is no laboratory associated with this course, however, there are programming assignments and projects. You can work on your programming assignments at home or in various "open" labs at Cal Poly. Note that all labs in Building 14 are closed labs that require special passwords for system access. I will give you a password for the labs for your use, however, this is ONLY for your CSC-234 homework.
Programming assignments and projects are individual efforts. While I do not discourage you from working together, your programs should be sufficiently different, otherwise I reserve the right to penalize both (all) of you for collusion.
Programming Work
Laboratory assignments and projects will be due at the the beginning of the first lecture of the week after they are assigned (which will be Monday or Tuesday, depending on the quarter/section).
Programming assignments will be short programs that build on the lecture topic. The first several will build on each other, that is, the second assignment will add features to the first and so on.
Programming projects will be similar to the assignments, however, the student will be designing a program that is similar to the one in the assignment. The purpose is to use the principles learned in the programming assignment in another program. While you may work with each other on these, each student must submit his or her own project. Projects that are too similar to the lab or too similar to anyone else’s will be marked down.
Programming work may be submitted in class, during office hours, or via the mail box outside the CSC Department Office (Room 14-254), which is emptied each day at 4:00 PM and time/date-stamped. Lab work will not be accepted via e-mail at this time, and you should not put work in the mailbox outside my office either.
Programming Assignments
There will be 9 laboratory programming assignments. As detailed in my lab manual, these include:
Lab 1 — A simple header file, to learn how to use the editor, and another lame program.
Lab 2 — A simple computational program, without and with a function.
Lab 3 — Selective execution, Lab 2 with an artificial set of upper and lower limits and then different conversion scales.
Lab 4 — Part 1: Repetitive execution (while), Lab 3 with the option to quit or continue (run again). Part 2: Repetitive execution (for), Part 1 with the ability to set a range of input/output values. Part 3: A for-loop design program.
Lab 5 — No assignment this week.
Lab 6 — Command-line parameters and the design of a function.
Lab 7 — Vending machine simulation.
Lab 8 — Automated Teller Machine simulator.
Lab 9 — Reading and writing simple text files.
Loss of Points in Programming Assignments and Projects
There are several easy ways to lose points. The first is to turn in your assignment or project late, which will result in a 75% (day late) or 100% (later yet) reduction in points. Each part of an assignment is usually worth 10 points, and each programming project is worth 10 points (except the final project, which is worth 100). Points will be deducted for the following:
Failure to include a run file -- 5 points.
Failure to update a source file header -- up to 3 points.
Failure to include a source file header -- 3 points.
Failure to properly test a program -- 2 points.
Failure to fix a program error -- 1 point each.
Submittal package out of order -- 1 point.
Failure to follow the assignment directions -- 5 points.
You have been warned. Resubmittal to regain lost points is not an option. Do it right the first time.
|
Ho mework Assignment and Project RequirementsWe do not have a lab, so each of you should be working by yourselves. Submissions are for each student. Submission shall consist of a printout of:
The source file will include a header which includes the student’s name, the instructor’s name, and the course and correct section number. The script file can be included at the end of the source file. It should show the program being tested for each newly added feature. For example, with the selective execution HW 3, the program should be run with one set of proper values, one set of values that exceeds the lower limit, and one set of values that exceeds the upper limit. When you add the command-line arguments, you should test with and without those for the three sets of values. |
Programming Projects
Each lab assignment will be somewhat routine and predefined. The intent of the programming project is to enable the student to write his or her own program similar to the homework assignment, one that may do something of interest to the student, or something different than the homework example.
How Will We Edit, Compile, and Run Our Programs? You should attempt to do as much of the course as possible under UNIX, since the secondary goal of this course is to learn UNIX. For that, you only need access to UNIX via a terminal program, such as QVTerm. UNIX has a wealth of editors, from the simple Pico (default editor in the Pine e-mail program), the very powerful vi (visual) editor, and Emacs. To compile the program, you use the UNIX cc compiler. In the DOS/Win environment, there is also a wealth of choices. I started out with around version 3.0 of Microsoft C, advanced through version 6.0, then switched to Visual C/C++ 1.0 for Windows 3.1, also known as version 7.0. I used others as well, but continue with Microsoft’s Visual Studio version 6.0 for Windows 98. Yes, it still does C, and it still does DOS. You can check out the CDROM from the Library, or you could just buy the Visual C++ part for a reasonable price as well. Other compiler companies include Borland and their Turbo C++ and C, and MetroWerks CodeWarrior, which does C++, C, and Java. And there are more as well that I am not familiar with. By the way, if you have a Mac, I suggest CodeWarrior. |
Final Programming Project
You will also be assigned a final programming project that must consist of a minimum of 100 SLOC (source lines of code). There will be options on this, including simply doing several simple program examples from the textbook. In the past, students have done as much as 1500 SLOC. Computer programming, like engineering, is often an affliction.
Quizzes
There will be five quizzes given in the lecture, with the lowest quiz score being dropped. Once a topic has been covered in lecture, you should be prepared for a quiz on that topic. Tentative quiz topics include:
Basic input/output
Data types
Selective execution (if)
Selective execution (switch/case)
Repetitive execution (while)
Repetitive execution (for)
Arrays
Functions
Before each quiz there may be a brief review of the topic which I deviously call, “Short Attention Span Theater.” If you can remember stuff for five minutes, you will do very well on the quiz.
E-Mail Issues
E-mail aliases are automatically maintained by the ITS people. These are generated by the information you have listed in Academic Records, and generally includes your Cal Poly e-mail account unless you have given them a different address. You should check your Cal Poly e-mail often. The e-mail alias is based on course number, section number, quarter, and year. For example, for Spring 2008 for section 1, this would be "csc-234-01-2084@calpoly.edu". I will often send you information via these aliases.
When you send me e-mail, you can send me the whole source file as an attachment and I will look at it and see if I can spot the problem. DO NOT send me the executable file since I cannot run it on my computer at home.
|
Classroom Behavior The easiest way to annoy me is to talk in class. The second easiest way to annoy me is to be late or absent for quizzes and other important aspects of the class. If I find you disruptive, I will expel you for the session. So behave. |
![]() |
|
These students insisted on talking in class and were turned to stone and left in the garden outside Dexter Hall. Don’t let this happen to you. |
Due Dates
I attempt to make each assignment achievable in the allotted time, but sometimes assignments take longer. Deadlines MAY be extended, however, you should plan on turning in assignments ON TIME for full credit, or be penalized for late submittals. This course lacks a lab and requires considerable work outside of class. Get used to it.
The standard due date is at the end of the first class meeting one week after it is assigned. Assignments left in the CSC wooden box by 4:00 will be time-stamped for the current day and not penalized. If an assignment is left after 4:00 PM, it will be time-stamped the next day and will be penalized 75%. Anything later than this will be penalized 100%. No exceptions!
On-Line Materials
I put the course syllabus on-line, with links to individual lecture pages. Those lecture pages are HTML files with links to three versions of each lecture: Native PowerPoint, outline format in RTF (rich text format), and OpenOffice Impress. I currently use OfficeXP, but save the files in OpenOffice format to ensure everyone can read them.
Lab assignments and handouts are published in the instructor’s lab manual, available from El Corral (should be on the shelf next to the textbook). There are errors in the lab manual which will be pointed out by the instructor and also noted on an Errata Sheet.
Tutoring
Tutoring is available from the Computer Science Department. That will be available in the evening in a lab, but will not start until later in the quarter. Tutors should understand C (they definitely understand Java), but be sure to take your lab manual with you for reference.
| Life Happens
Emergencies and conflicts arise. Absence is not accepted, however, absences can be handled if conditions warrant. I am more liberal if I know about anticipated absences before they happen. If you are contagiously ill, let me know, stay home, and arrange to make up the work in some way. Same goes for family emergencies, interview trips, etc. If something comes up or is coming up, call me or at least send me e-mail (which is time and date stamped). If you tell me before it happens, I am very liberal. Afterwards, I could care less and you will be out of luck. |
Patience is Appreciated
There may be up to 35 students in this course. I am here to help you and I intend to do this. However, please understand that at times I will be spread pretty thin among you, so please be patient.
By all means call on me if you need help. You could ask other students for help, but you must consider that they may not know the answer either. Rather than “bother” another student, just kick back and patiently wait for me to get to you.
![]() |
Cheating is detectable and will not be tolerated. The penalties are too high and not worth it. In the past, students have been beheaded, covered with clay, fired in a kiln, and displayed outside Dexter Hall. Unless you like pain and heat, don’t do it.
|
Completely revised 1/06/2009 to make consistent with published syllabus.