Fundamentals of Programming Lecture 1 Hamed Rasifard 1 Outline - - PowerPoint PPT Presentation

fundamentals of programming
SMART_READER_LITE
LIVE PREVIEW

Fundamentals of Programming Lecture 1 Hamed Rasifard 1 Outline - - PowerPoint PPT Presentation

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.


slide-1
SLIDE 1

Fundamentals of Programming

Lecture 1 Hamed Rasifard

1

slide-2
SLIDE 2

Outline

Introduction Course Policies

Course Organization Grading Policy, Late Policy, Reevaluating Academic Honestly Course Overview

2

slide-3
SLIDE 3

Introduction

My name is Hamed Rasifard M.Sc. in Computer Engineering

3

slide-4
SLIDE 4

Course Organization

You just follow course book and lectures Course book: C How to Program, 6th Edition

4

slide-5
SLIDE 5

Grade Distribution

Final Exam: 7 grades Midterm Exam: 5 grades Assignments: 4 grades Quiz: 2 grades Project: 2 grades Class Activity: +1 grades

5

slide-6
SLIDE 6

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

slide-7
SLIDE 7

Reevaluating Policies

Missed grades or summation errors will be evaluated Discuss concerns with your solution with me Penalty Policy

7

slide-8
SLIDE 8

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

  • therwise) 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

slide-9
SLIDE 9

Course Overview

Basic Computer Concepts Calculation in Computer Systems Programming Principles Input/Output Format in C Algorithm, Flowchart, and Sudo-Code Control Structures

9

slide-10
SLIDE 10

Course Overview(Cont.)

Functions Test and troubleshooting Arrays Pointers Characters and String Abstract Data Types, and Classes

10

slide-11
SLIDE 11

Okay, so letʼs get started…

11

slide-12
SLIDE 12

What is a Computer?

A set of devices capable of

Performing computation Make decision Repeat fast

12

slide-13
SLIDE 13

Computer Principles

Hardware

Central Process Unit(CPU) Main Memory I/O Units Data and Control Busses Hard Drive

Software

Operating System Applications

13

slide-14
SLIDE 14

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

slide-15
SLIDE 15

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

slide-16
SLIDE 16

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

slide-17
SLIDE 17

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

slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

Strengths of C

Efficiency Portability Power Flexibility Standard Library Integrated with Unix

20

slide-21
SLIDE 21

Weaknesses of C

C programs can be:

Error-Prone Difficult to Understand Difficult to modify

21

slide-22
SLIDE 22

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

slide-23
SLIDE 23

Keywords Added by C99

_Bool _Imaginary restrict _Complex inline

23

slide-24
SLIDE 24

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

slide-25
SLIDE 25

C’s Memory Map

25

slide-26
SLIDE 26

First C Program

#include <stdio.h> int main(void) { printf(“To C, or not to C: that is the question.\n”); return 0; }

26

slide-27
SLIDE 27

Compiling and Linking

Preprocessing Compiling Linking

27