Fundamentals of Programming Lecture 1 Hamed Rasifard 1
Outline Introduction Course Policies Course Organization Grading Policy, Late Policy, Reevaluating Academic Honestly Course Overview 2
Introduction My name is Hamed Rasifard M.Sc. in Computer Engineering 3
Course Organization You just follow course book and lectures Course book: C How to Program, 6th Edition 4
Grade Distribution Final Exam: 7 grades Midterm Exam: 5 grades Assignments: 4 grades Quiz: 2 grades Project: 2 grades Class Activity: +1 grades 5
Policies Late Homework One day late will cost you 25%, two days 50%, and three days 75% No homework will accept after three days Cheating and Copying First time you caught you will get a zero for the task at hand Second time you caught you will get a -100 for the task Third time you caught you will fail the course 6
Reevaluating Policies Missed grades or summation errors will be evaluated Discuss concerns with your solution with me Penalty Policy 7
Academic Honestly Any collaboration is accepted Gilligans Island Rule (an inspiration of Professor Larry Ruzzo from University of Washington) : This rule says that you are free to meet with fellow students(s) and discuss assignments with them. Writing on a board or shared piece of paper is acceptable during the meeting; however, you may not take any written (electronic or otherwise) record away from the meeting. This applies when the assignment is supposed to be an individual effort. After the meeting, engage in half hour of mind-numbing activity (like watching an episode of Gilligan's Island), before starting to work on the assignment. This will assure that you are able to reconstruct what you learned from the meeting, by yourself, using your own brain. 8
Course Overview Basic Computer Concepts Calculation in Computer Systems Programming Principles Input/Output Format in C Algorithm, Flowchart, and Sudo-Code Control Structures 9
Course Overview(Cont.) Functions Test and troubleshooting Arrays Pointers Characters and String Abstract Data Types, and Classes 10
Okay, so let ʼ s get started… 11
What is a Computer? A set of devices capable of Performing computation Make decision Repeat fast 12
Computer Principles Hardware Central Process Unit(CPU) Main Memory I/O Units Data and Control Busses Hard Drive Software Operating System Applications 13
A brief History of C BCPL (Basic Combined Programming Language) designed by Martin Richards of the University of Cambridge in 1966. Intended for writing Compilers for other languages(suitable for writing Bootstrapping) The BCPL Language is Clean, Powerful, and Portable 14
A brief History of C (cont.) BCPL influenced B B was developed in Bell Lab, in 1969 B influenced C C was invented and first implemented by Dennis Ritchie, in 1970s The ANSI C standard was adopted in 1989(C89) 15
A brief History of C (cont.) C89 was adopted by ISO so it is called ANSI/ISO Standard C89 became base document for Standard C++ C99 is adopted in 1999 16
C is Middle-Level Language Allow manipulation of Bits, Bytes, and Addresses Has several built-in data types Almost no run-time error checking No strict type compatibility checking between parameter and argument Has small set of Keywords 17
C is Structured Language C is Structured, not Block-Structured compartmentalization of code and data Offers Several Programming possibilities Functions are main structural component Code block is another component 18
C is Programmer’s Language Was created, influenced, and field-tested by working programmers gives the programmer what them wants Few restrictions Few complaints Structured Language Stand-alone functions 19
Strengths of C Efficiency Portability Power Flexibility Standard Library Integrated with Unix 20
Weaknesses of C C programs can be: Error-Prone Difficult to Understand Difficult to modify 21
C89’ Keywords auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while 22
Keywords Added by C99 _Bool _Imaginary restrict _Complex inline 23
General Form of a C Program Global declarations int main(parameter list) { statement sequence } return-type f1(parameter list) { statement sequence } return-type f2(parameter list) { statement sequence } . . . return-type fN(parameter list) { statement sequence } 24
C’s Memory Map 25
First C Program #include <stdio.h> int main(void) { printf(“To C, or not to C: that is the question.\n”); return 0; } 26
Compiling and Linking Preprocessing Compiling Linking 27
Recommend
More recommend