Introduction
Download
Report
Transcript Introduction
CGS 3460
CGS 3460
PROGRAMMING USING C
Summer 2007
Instructor: Neko Fisher
TAs: Ritwik Kumar
CGS 3460
A Survey
Summer A / B allot 75 minute periods
Summer C is supposed to use 65 of the 75 minutes
34 Periods @ 65 minutes / period = 2210 minutes
If we use 75 minutes we need 2210/75 = 29.4 periods
So we can cancel 4 – 5 classes
What would you like?
65 minute periods
75 minute periods
CGS 3460
Goals
We will learn
Read: Understand programs written in C language
Write: Design and implement programs using C language
Compile: Use compiler to convert C code into executable file under UNIX
Execute: Run corresponding code to get results
Debug: Identify and fix syntax and semantic errors in C code.
Appropriate for
Technically oriented people with little or no programming experience
Experienced programmers who want a deep and rigorous treatment of the language
CGS 3460
New View of Computers
From a programmer’s viewpoint
Computers are tools
A computer program turns raw data into meaningful information
A program is the driving force behind any job that any computer does
• A program is a list of detailed instructions
• These instructions are written in certain programming language
CGS 3460
Available Programming Languages
Machine Languages
Assembly Languages
High-level Languages
C/C++
COBOL
Pascal
BASIC
Fortran
JAVA
Etc.
CGS 3460
Machine Languages
System of instructions and data directly understandable by a
computer's central processing unit.
Example:
100011 00011 01000 00000 00001 000100
000010 00000 00000 00000 10000 000001
000000 00001 00010 00110 00000 100000
Every CPU model has its own machine code, or instruction set,
although there is considerable overlap between some
CGS 3460
Assembly Languages
Human-readable notation for the machine language that a specific
computer architecture uses representing elementary computer
operations (translated via assemblers)
Example:
load hourlyRate
mul workHours
store salary
Even into the 1990s, the majority of console video games were
written in assembly language.
CGS 3460
High-level Languages
Higher level of abstraction from machine language
Codes similar to everyday English
Use mathematical notations (translated via compilers)
Example:
salary = hourlyRate * workHours
Make complex programming simpler
CGS 3460
Why Programming using C
Initial development occurred at Bell Labs in early 70’s by Ritchie
General-purpose computer programming language
high-level assembly
Simplicity and efficiency of the code
The most widely used programming languages
Commonly used for writing system software
Widely used for writing applications
Hardware independent (portable)
Great influence on many other popular languages
CGS 3460
Textbooks
Required
Programming in C (3rd Edition) by Stephen Kochan. ISBN: 0672326663
Recommended Reading
C: A Reference Manual (5th Edition) by Harbison ISBN: 013089592X
CGS 3460
Outline of the Course – I
Introductions
Familiarization with programming environment, telnet / SSH Secure Shell, ftp / SSH Secure File Transfer,
UNIX, Compiling / gcc
C program structure
Basic data types and variables declaration
Arithmetic expressions and operators
Control statements.
Conditional statements
The while loop
The do while loop
The for loop
The if else statement
The switch statement
The break statement
The continue statement
CGS 3460
Outline of the Course – II
Formatted Input and Output
Arrays and Strings
Functions
Declarations
Calling
Pointers
Struct, Union, Enums
Preprocessor
* Advanced Material
Debug using gdb
Arrays and Pointer Arithmetic
Binary Trees
Link Lists
Recursive Functions
* may be adjusted according to time and interests of students
CGS 3460
Grading Scale
You earn your grade
Final grade is calculated according to the following schedule
Home works
Quizzes
Mid-term exam
Final exam / Project
30%
20%
20%
30%
Grade scale is:
A(100-90),B+(89-85),B(84-80),C+(79-75),
C(74-70),D+(69-65),D(64-60),F(59-0)
CGS 3460
Policies
Attendance and Expectations
Homework Policies
Make-up Exam Policy
Other Policies
Re-grading
Course is on WebCT
http://lss.at.ufl.edu/
http://www.cise.ufl.edu/~cgs3460su07/
CGS 3460
Then
ENIAC I (Electrical Numerical Integrator
And Calculator)
500,000 dollars
Thousand times faster
17,468 vacuum tubes
70,000 resistors
10,000 capacitors, etc
1,800 square feet floor space
30 tons
160 kilowatts of electrical power
357 Instructions Per Second
The ENIAC 1946
From www.answers.com
CGS 3460
Now
Microchips
1.50 dollars
More powerful than ENIAC
The ENIAC 1946
From http://www.answers.com
CGS 3460
Operating System
What is an OS?
A program that allows you to interact with the computer -- all of the software and
hardware
• With a command-line operating system (e.g., DOS)
• With a graphical user interface (GUI) operating system (e.g., Windows)
Two major classes of operating systems
Windows
• Nice interface, easy to learn
Unix
• reliable timesharing operating system
CGS 3460
Why we choose UNIX
Powerful
Multi-user operating system
Good programming tools
• Most heavy-duty database management systems started out on Unix
Flexible
Thousands of tools that can be combined and recombined.
Reliable
Unix is hard to crash.
CGS 3460
What now
Fill out survey on webct
Get cise account (Go to CSE 114):
http://www.cise.ufl.edu/help/acct.shtml