Programming in C

Updated 2021-01-20

Syllabus

C Course outline

Day #1

Install the Tiny C Compiler (TCC) on your computer (technically, you don't install it; you just copy it to your computer). Video.

Resources

         Tiny C compiler

         Tiny C documentation

         An easy-to-use editor that knows C syntax: Notepad++. Note that you can use any text editor to create programs. There are many free, good alternatives. You can even use Notepad.

         Some online resources: C tutorial/documentation, Fresh, Interactive tutorial, Beginner's Book.
I have only skimmed these. Let me know if they are useful, or if you find something better.

         You will have to run TCC from the command line. Command line tutorial (first in a series of videos).

Program #0

Write a "Hello World!" program in C (prints out the text "Hello, World!". Use printf for output. Name your program hello-world.c. Put a comment at the top of the program with your name and the name of the assignment (Hello World). Put the "hello-world.c" file in the drop box. Due Sunday, 1/24/2021 at 11:59 p.m.

This problem involves arrays in C. Array resources: Web page, Video. Booleans in C. For loops in C.

Program #1:

Topics: Character data, while loops. Identifying characters. Problem description. Due Sunday, 1/31/2021 at 11:59 p.m.

Program #2:

Topics: Functions, for loops, formatted output. Loan payments. Problem description. Due Sunday, 2/07/2021 at 11:59 p.m.

Program #3:

Topics: Input, output, arithmetic. Irrigation pivot. Problem description. Due Sunday, 2/14/2021 at 11:59 p.m.

Program #4:

Topics: Bit-wise operators in C. Counting bits. Problem description. Due Sunday, 2/21/2021 at 11:59 p.m.

Program #5:

Topics: Arrays. The drunk jailer. Problem description. Due Sunday, 2/28/2021 at 11:59 p.m.

Program #6:

Topics: More arrays: Passing an array to a function, stepping through an array, finding min, max, sum, average. Sorting an array. Problem description. Due Sunday, 3/14/2021 at 11:59 p.m.

Program #7:

Topics: Functions, loops. Odometer palindromes. Problem description. Due Sunday, 3/21/2021 at 11:59 p.m.

Program #8:

Topics: More arrays: Using pointers to access an array. Problem description. You will need to know how to "de-reference" the array pointer in the function. Due Sunday, 3/28/2021 at 11:59 p.m.

Program #9:

Topic: Text input files. Problem description. Some useful functions: fopen, feof, fscanf. Due Sunday, 4/04/2021 at 11:59 p.m.

Program #10:

Topic: Strings. Problem description. Due Sunday, 4/11/2021 at 11:59 p.m.

 

 

Extra Credit program: Breaking a dollar. This program is also an actual problem from a prior programming contest. It requires you to generate all permutations of a set of numbers, which is something that comes up in programming contests fairly often. Due Date: Friday, 12/07/2012 at 11:59 p.m.

Program #8: Planetary Time. Due Wednesday, 10/31/2012 at 2:00 p.m.

Program #7: Triangular Numbers. Due Wednesday, 10/24/2012 at 2:00 p.m.

Program #1: Amortization table. This program is pretty straightforward. You will have to read data from a file, print output to the screen, and do some basic computation. There will NOT be any programs this easy at the programming contest. The purpose of this program is for you to get used to using Java again. Due Date: Wednesday, 9/12/2012, at 2:00 p.m.

Program #5: Points on a line, due date: Friday, 10/17/2008.

Program #6: Caesar cipher, due date: Friday, 10/24/2008.

Optional Program #7: Lingo, due date: Friday, 10/31/2008. If you missed a due date for an earlier assignment, this can make up for it.