CGS 3460 Computer Programming Using C

Section 1060, Spring 2008

 Announcements   Lecture Schedule   CourseWorX 

Credits: 3
Place: CSE Building, E222
Time: M W F 3 (9:35am - 10:25am)

Instructor:
Venkatakrishnan Ramaswamy
Office: CSE E522
Email: Venkat's email
Phone: TBA
Office hours: Monday 4 (10:40 - 11:30 am), Friday 10 (5:10-6:00 pm) or by appointment.

Teaching Assistants:
Cem Boyaci
Office: CSE E309
E-mail: cgs3460sp08@cise.ufl.edu
Phone: 392-####.
Office hours: Monday 6 (12:50- 1:40 pm) and
Wednesday 6,7,8 (12:50- 3:50 pm)
Xiaoke Qin
Office: CSE E309.
E-mail: cgs3460sp08@cise.ufl.edu
Phone: 392-####.
Office hours: Tuesday 6,7 (12:50-2:45pm) and
Thursday (1:55-3:50pm)

Prerequisites: MAC 1147/equivalent or instructor's permission.

Tentative list of topics to be covered: This is a tentative list, which might be adjusted due to time constraints or class interest.

Textbook: Programming in C (3rd Edition) by Stephen Kochan. ISBN: 0672326663
Reference: The C Programming Language (2nd Edition) by Brian W. Kernighan and Dennis M. Ritchie.

Grading: The final grade will be on the curve.

Course policies:

Announcements

Please hit the REFRESH button of your browser to make sure you are not seeing an older cached version of this page.

Last modified: Wed Apr 23 12:07:43 2008

This is new05/02/2008: Grade and solutions of HW6 are available on CourseWorX. The average shown in CourseWorx is invalid.

This is new04/25/2008: Venkat's office hour today [Friday (5:10 - 6:00 PM)] is canceled. For questions Cem will be in CSE 309 between 5:00-6:00 PM.

This is new04/23/2008: If you downloaded sample0.txt before this announcement, make sure you download the current version. The old sample0.txt did not work correctly.

This is new04/22/2008: Here are two sample saved files for the project: sample0.txt sample1.txt We will be using similar files to test your project, so it is important that your file format confirm to that of the spec. (Note that they are text files and not binary files)

This is new04/21/2008: Cem's office hours today are canceled. If you have questions, see Venkat in his office (CSE E522).

This is new04/21/2008: Exam 3 will test you on material covered through Friday Apr 18 (and since Exam 2).

This is new04/16/2008: Homework 6 solution are now available: problem 1 problem 2

This is new04/16/2008: Project spec update: it turns out that there no standard easy way to implement the "press any key to continue" feature. So, it is sufficient if you ask the user to "Press the enter key to continue" instead.

This is new04/10/2008: Homework 6 is now up. This will be the last homework.

This is new04/09/2008: Parts of an earlier version of the project spec seemed to suggest that there were 19 rows and 19 columns in the board (instead of 15 rows and 15 columns). This has now been fixed.

This is new04/02/2008: The project specification is now available.

04/01/2008: Grade and solutions of HW5 are available on CourseWorX. The average shown in CourseWorx is invalid.

03/31/2008: Through Exam 2, 54.29 % of your grade has been determined (assuming we will have 7 homeworks, totally). The average is 36.88, the median is 39.25. Here is the histogram:

03/26/2008: More information on curving is here.

03/24/2008: Homework 5 is now up

03/21/2008: As announced in class, if you have a conflict for Exam 3, you must email Venkat by the end of next week, specifying which course you have an exam conflict with and your schedule on the same day.

03/21/2008: You have until March 31 to to seek clarifications/request regrades for Exam 2.

03/20/2008: Exam 2 scores are now available via Courseworx. The average shown in CourseWorx is invalid. The real average is 65. The The median is 73.
You can get the exams back during office hours. Here is a note on grading.
Cem graded questions 1, 2, Venkat graded 3 and Xiaoke graded 4 and 5.
Here is the histogram with the score distribution for Exam 2:

03/17/2008: Exam 2 solutions are available here.

03/04/2008: Grade and solutions of HW4 are available on CourseWorX.

03/02/2008: Some observations (you should make) pertaining to Homework 4:

02/29/2008: Exam 2 will test you on material taught since the first exam (which corresponds to Chapters 7, 8 and 10 of text).

02/29/2008: A good source of more examples and programming exercises is Schaum's Outline of Programming with C. The library has this as an e-book accessble here (if you are accessing from within UF). If you are off-campus, login using UF proxy and search for the book from the UF library page.
Please be sure to click Close item, if you are not using the book for some time, because the website only allows a fixed number of people to simultaneously view the book.

02/29/2008: Homework 3 scores are now available on Courseworx. Cem graded this homework. As always, you have one week to seek clarifications/request regrades.

02/28/2008: Homework 3, problem 1 solution had a "printf" formatting error. The latest version is available at: problem 1

02/27/2008: Homework 4 is now up. Note that the second question pertains to recursion, which we will cover Friday.

02/27/2008: Venkat's office hours henceforth will be held in CSE E522 (instead of E309).

02/25/2008: Exam 1 scores are now available via Courseworx. You can get the exams back during office hours. Here are the exam solutions and a note on grading.
All clarifications/regrade requests for Exam 1 and Homework 2 must be sought by the end of next Monday. Cem graded questions 1, 2, 3, Venkat graded 4 and Xiaoke graded 5 and 6.
Here is the histogram with the score distribution for Exam 1:

02/23/2008: Homework 3 solution are now available: problem 1 problem 2

02/21/2008: For Problem 2, observe that fgets also appends a '\n' at the end of string. However, you will not check for the presence of a '\n' in s1 after an instance of s2 is found.
For Problem 1 (as mentioned in class), remember to link to the math library using the -lm switch, while compiling with gcc.

02/20/2008: Test cases for Problem 1 are now available in the note. Remember that we will also test your program with other test cases.

02/20/2008: For Problem 2, assume indices start at zero (as in C). You just need to report the starting index of the substring in the other string (if the substring is present).

02/17/2008: Homework 3 deadline is extended by 24 hours. It is due back thursday night instead. I wanted to do a few more example problems in class to help you tackle Problem 2.

02/18/2008: In Problem 2, use fgets to get input, instead of scanf (as was stated in the problem).

02/17/2008: In Problem 1 of Homework 3, the eigenvalues to be computed are for the sample covariance matrix, not the vectors.

02/17/2008: Here is a note on Problem 1 of Homework 3.

02/15/2008: Homework 3 is now up.

02/08/2008: Grade and solutions of HW2 are available on CourseWorX. Note that “Total points earned so farἿand “Assignment Weight᾿fields are invalid.

02/08/2008: As announced in class (and the website), Exam 1 is on Monday, Feb 11 at MCCB G086 between 8:20pm and 10:10pm. The exam is closed book/notes. No calculators or cheat sheets are allowed. Material covered through today (including readings) will be tested.

02/04/2008: When you use scanf to input a character, once you hit enter, the '\n' character is stored in the buffer, which is passed on to your variable when you do a scanf next to get another char from input. The way around this is to declare another variable say tmp (of type char), and assuming you want to read in the variable c, use something like this (so that the '\n' is read into tmp):
scanf("%c%c", &c, &tmp);

02/04/2008: Turns out a couple of things I said Friday were not accurate. Here is the correct story. I will also go over it in class today.

01/31/2008: Homework 2 is now up.

01/30/2008: Homework 2 will be posted Thursday night, instead of tonight.

01/30/2008: You have one week to seek clarifications/request regrades pertaining to Homework 1 grading. Please see Xiaoke (who graded Homework 1) for this.

01/29/2008: Grade and solutions of HW1 are available on CourseWorX. Note that “Total points earned so farἿand “Assignment Weight᾿fields are invalid.

01/28/2008:Couple of announcements about the homework:

01/24/2008: Homework 1 is now up.

01/19/2008: Henceforth, please direct all TA email to the email ID cgs3460sp08@cise.ufl.edu, instead of sending email to their individual email addresses. One of the TAs will reply, after which you may send any follow-up question to that TA (on the ID from which he replied).

01/16/2008: Please register your ID in Courseworx. Here is a page that tells you how.

01/10/2008: Two copies of the text are now available on reserve at Marston Science Library. A copy of the reference book is also available.

01/09/2008: Office hours have been posted.

01/09/2008: A brief tutorial for cygwin installation can be found here

01/09/2008: The reference book (K&R) is now available on reserve at the Marston Science library for a 2-hour loan. Two copies of the text are also expected to be available there soon.

01/07/2008: Here is how you can get a CISE computer account for the class. This should also get you access (by swiping your Gator1 card) to E114, our 24x7 computer lab. Please apply for your account as soon as possible.

01/07/2008: Welcome !


Summary of class activity:

tr>
Date Topics covered in class Programs
etc.
Readings Other links
Jan 7
(Lecture 1)
Introduction
Jan 9
(Lecture 2)
Grading and Course policy, Operating System basics, Introduction to Unix. Unix Tutorial
(upto Tutorial 5)
Jan 11
(Lecture 3)
Editing with emacs, "Hello World" program. first.c Chapter 2 of text
Line-by-line dissection of "Hello World"
Emacs Beginner's HOWTO
GNU Project
Jan 14
(Lecture 4)
Counting, Positional number systems - decimal, binary, hexadecimal, binary addition.
Boolean Algebra - truth tables, AND, OR, NOT gates.
Number Systems
Jan 16
(Lecture 5)
XOR gate, Noise in electrical circuits and voltage quantization, Half Adder, Full Adder, Registers, left-shift, right-shift, multiplication and control using logic gates.
Jan 18
(Lecture 6)
Memory, Basic Computer organization, Assembly code, Object code, example assembly program and its machine code, Types of instructions, instruction cycle, Program counter, instruction register, Stages of compilation, linker, loader.
Jan 23
(Lecture 7)
Converting C source to assembly (gcc -S), Converting assembly to object code using assembler (as), viewing machine code using od and objdump. C programming - comments, variables, int, assignment operator, more on printf, example program to add and subtract two numbers. second.c
add.c
Chapter 3 of text
Jan 25
(Lecture 8)
Using ssh and scp, scanf and example, float and example Command-line transcript
add2.c
tempconv.c
How To Ask Questions The Smart Way

Undergraduation
Jan 28
(Lecture 9)
Operator precedence and associativity, Type conversion - automatic, typecasting. variables, constants.
Jan 30
(Lecture 10)
char data type, float data type, double, long double, % operator, arithmetic assignment operators (+=, -=, *=, /=, %=) sizeof.c Chapter 4 of text,
Conversion characters (Page 350),
Escape sequences (Page 428) and
Operator precedence table (Page 440)
Feb 1
(Lecture 11)
Increment/Decrement operators, relational operators, for loop squares.c
Feb 4
(Lecture 12)
for loop and variants, if, if..else. factorial.c
factorial2.c
factorial3.c
if1.c
if2.c
Feb 6
(Lecture 13)
if, else if, nested if, compound relational expressions, break, continue, nested for if3.c
if4.c
factorial4.c
oddsum.c
Feb 8
(Lecture 14)
while, do, switch, logical NOT (!), goto p3.c Chapter 5, Chapter 6 of text
Feb 11
(Lecture 15)
Example program - decimal to binary conversion dec2bin.c
 
Feb 11
(8:20pm-10:10pm)
Exam 1
(at MCCB G086)
 
Feb 13
(Lecture 16)
Arrays - declaration, initialization, access. Multidimensional arrays. average.c
Feb 15
(Lecture 17)
Matrix multiplication program, Strings in C - declaration, representation, buffer overflow. sqrt.c
matrixmult.c
Feb 18
(Lecture 18)
Strings in C continued.. safescanf.c Chapter 7 of text
Feb 20
(Lecture 19)
DeMorgan's laws, Strings - example programs strlen.c
strlen_easy.c
strcpy.c
strcat.c
Page 470 of text (string functions)
Feb 22
(Lecture 20)
Functions print_hello.c
factorial_function.c
Chapter 10 of text (Character strings)
Feb 25
(Lecture 21)
External variables, automatic variables, static variables, scope and lifetime, passing arrays as arguments, linear search. static_example.c
Feb 27
(Lecture 22)
More on passing arrays to functions, binary search. binarysearch.c
Feb 29
(Lecture 23)
Recursive functions. factorial_rec.c
binarysearch_rec.c
Chapter 8 of text
Mar 3
(Lecture 24)
Recursive functions continued..: Stack frames, Recursive Binary Search, Introduction to Quicksort - putting the pivot in its correct position.
Mar 5
(Lecture 25)
Quicksort implemented recursively. quicksort.c
Mar 6
(8:20pm-10:10pm)
Exam 2
(at MCCB G086)
Mar 17
(Lecture 26)
Structures Chapter 9 of text
Mar 19
(Lecture 27)
Structures continued., unions. Page 375-377 of text (Unions)
Mar 21
(Lecture 28)
Enumerations. Page 321-325 of text (Enumerations)
Mar 24
(Lecture 29)
Structures, unions, enumerations example, Pointers - Introduction student.c
Mar 26
(Lecture 30)
Pointers - declaration, addressof operator, indirection operator.
Mar 28
(Lecture 31)
Pointer assignment, Pointers and functions.
Mar 31
(Lecture 32)
Pointer arithmetic, Pointers and arrays.
Apr 2
(Lecture 33)
Multidimensional arrays, const pointers (two types), passing const pointers to functions, Pointers and structures Chapter 11 of text.
Apr 4
(Lecture 34)
Generic pointers (void*), Dynamic memory allocation Page 383-388 of text (Dynamic memory allocation)
Apr 7
(Lecture 35)
Dangling pointers, string concatenation example, variable-length multidimensional arrays, realloc
Apr 9
(Lecture 36)
#define, typedef, I/O redirection, File handling - Streams, file pointers.
Apr 11
(Lecture 37)
Text files and binary files, buffering, fopen, fclose, Character I/O - getc, putc, Block I/O - fread, fwrite. Chapter 16 of text
Apr 14
(Lecture 38)
More file handling feof, fflush, fseek, ftell, rewind<\tt>.
Apr 16
(Lecture 39)
Line I/O - fgets, fputs, Formatted I/O - fprintf, fscanf, Function pointers.
Apr 18
(Lecture 40)
Self-referential structures. Introduction to linked lists. The C Preprocessor - Introduction and motivation
Apr 21
(Lecture 41)
Conditional expressions (ternary operator), C Preprocessor - macros, parameterized macros, conditional compilation.
 
Apr 23
(8:20pm-10:10pm)
Exam 3
(at MCCB G086)
 
May 2
(7:30am)
PROJECT DUE




Valid HTML 4.01!