Presentation is loading. Please wait.

Presentation is loading. Please wait.

CGS3460 Summer 2011 Programming Using C Andrei Todor.

Similar presentations


Presentation on theme: "CGS3460 Summer 2011 Programming Using C Andrei Todor."— Presentation transcript:

1 CGS3460 Summer 2011 Programming Using C Andrei Todor

2 Syllabus http://www.cise.ufl.edu/class/cgs3460su11/ Class Study Program Homework (25%) Quiz (25%) Midterm(25%) Final(25%)

3 Computer Programming Program Computer program Problem – General - e.g.: find minimum of a list of numbers – Instance - e.g.: find minimum of 3,4,-1 Solution – General: e.g.: look at each number – Instance: -1

4 Computer Programming Algorithm – Solution to a general problem – Input: instance of the problem – Output: solution for the instance of general problem Pseudocode – Formal description of steps – E.g. Store the value of the first number Look at each number and if it is smaller than the stored value, replace it Output the stored value

5 Computer Programming Machine Language – E.g.: 0110111001 Programming language – Between pseudocode and machine language – E.g.: C – Syntax (grammar) Compiler – e. g. gcc Execution

6 Computer Programming Errors – Syntax – compile time – Logical (bug) – run time Debugger

7 Overview Solution/AlgorithmProblem Pseudocode Program/Source Code Programming Language (C) Executable Program Machine Language PaperText file Binary file Paper solve English code implement compile Output (Solution to problem instance) execute Input Data (Problem instance)

8 Programming Environment Get class account – http://www.cise.ufl.edu/help/account.shtml http://www.cise.ufl.edu/help/account.shtml – UNIX servers thunder.cise.ufl.edu storm.cise.ufl.edu

9 Programming environment Remote terminal access Remote file transfer EditorCompilerIDE UNIX – local (CISE labs) NA emacs gedit gccKDevelop UNIX – remote (other Unix computers) local, ssh,sftpemacsgccNA Windows&UNIXPuttyWinSCPemacsgccNA WindowsNA VimMinGWDev-C++ Visual Studio

10 Basic UNIX Use Putty to connect to thunder Working directory: pwd, cd,. Up directory:.. Home directory: ~

11 First C program emacs hello.c CTRL+X CTRL+C to save gcc hello.c Execute gcc argument –o Details of gcc – Preprocessing – Compilation – Link-editing

12 C syntax BNF ::= ::= [ ] ::= |… ::= #include >

13 C syntax ::= [ ] ::= ::= ::= { [declarations][ ] }

14 C syntax ::= [ ] ::= ; | |… ::= | |…

15 C syntax ::= |… ::= ::= ([,…]) ::=return

16 C Syntax ::= | ::=[-]digits[.][digits] ::= [ ] ::=0|1|…|9 ::=“ ” ::= ::=A|B|…|z|0|…|9|(|)|!| |.|*|…


Download ppt "CGS3460 Summer 2011 Programming Using C Andrei Todor."

Similar presentations


Ads by Google