Upload
lester-foster
View
224
Download
0
Embed Size (px)
Citation preview
CGS 3460
CGS 3460 PROGRAMMING USING C
CGS 3460 PROGRAMMING USING C
Summer 2007
Instructor: Neko Fisher
TAs: Ritwik Kumar
CGS 3460
A SurveyA 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
GoalsGoals 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 ComputersNew 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 LanguagesAvailable Programming Languages Machine Languages Assembly Languages High-level Languages
C/C++ COBOL Pascal BASIC Fortran JAVA Etc.
CGS 3460
Machine LanguagesMachine 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 LanguagesAssembly 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 LanguagesHigh-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 CWhy 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
TextbooksTextbooks 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 – IOutline 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 – IIOutline 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 ScaleGrading Scale You earn your grade Final grade is calculated according to the following schedule
Home works 30%
Quizzes 20%
Mid-term exam 20%
Final exam / Project 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
PoliciesPolicies 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
ThenThen 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
NowNow Microchips 1.50 dollars More powerful than ENIAC
The ENIAC 1946
From http://www.answers.com
CGS 3460
Operating SystemOperating 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 UNIXWhy 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 nowWhat now Fill out survey on webct Get cise account (Go to CSE 114):
http://www.cise.ufl.edu/help/acct.shtml