Presentation is loading. Please wait.

Presentation is loading. Please wait.

INTRODUCTION Introduction to Computer Science I - COMP 1005, 1405 Instructor : Behnam Hajian

Similar presentations


Presentation on theme: "INTRODUCTION Introduction to Computer Science I - COMP 1005, 1405 Instructor : Behnam Hajian"— Presentation transcript:

1 INTRODUCTION Introduction to Computer Science I - COMP 1005, 1405 Instructor : Behnam Hajian bhajian@scs.carleton.ca

2  Attention:  A large amount of material in this set of slides has gotten from course notes prepared by Dr. Mark Lanthier.

3 Objectives and syllabus The objectives in this course is  To indentify the basic view of architecture of a computer.  To expose students to a high level programming language (i.e., java).  To make students learn the basic programming concepts.

4 Where are you? Where you are? What you learn?

5 Objectives and syllabus  An introduction to Computer Science and Problem Solving.  Variables and Object.  Data Structure.  Control statements (if-else, switch-case).  Loops (while, for).  2D graphics.  Array, and list.  Methods and Functions.  Calculations, Formatting and Conversions.  Sorting.  Recursion.  Shared data

6 Evaluation, Course information: Evaluation:  6 programming assignments:30%  3 Quizzes (in-class exams):30%  Tutorials participation 10%  Final Exam: 30% Website:  Course material will be available on WebCT or the course link in my webpage.  https://lms.carleton.ca/webct OR http://people.scs.carleton.ca/~bhajian/comp1005/winter2012 https://lms.carleton.ca/webct Lectures:  Monday&Wednesday 14:35 PM – 15:55 PM@ 103 Steacie Building (SC).

7 Course information Office hours:  Monday & Wednesday 4PM - 5 PM @ HP 5331 TextBook:  Course notes of Introduction to Computer Science 1 mainained by Mark Lantier uploaded in WebCT. References:  Getting Started with Processing, Casey Reas and Ben Fry  http://processing.org/shop/

8 Computers  What is a computer?  A computational device  Logical decisions billions of times faster than humans  Hardware keyboard, screen, disks, memory, CPU  Software email, word processing, spreadsheets, OS

9 What are Computers Used For?  Communications: Internet, e-mail, cell phones  Word Processing: typing/printing documents  Business Applications: accounting, spreadsheets  Engineering Applications: scientific analysis, simulations  Database Management: police records, stock market  Entertainment: games, multimedia applications  Manufacturing: CAD/CAM, robotics, assembly ... many more...

10 Who is Involved With Computers ?  System/Hardware Designers = people that design computers and related products.  Manufacturers = people that actually build and assemble computers.  Software Designers = people that design applications to be used with the computers.  Programmers = people that write computer programs to achieve working applications, games and other software packages.  End User = people that buy and use the software when it is done.  We are going to play the role of the Programmer in this course.

11

12 Computer Organization  Input unit  keyboard, microphone  Output unit  screen, printer  Memory unit  Random Access Memory (RAM) short-term, rapid access, low capacity warehouse  Read only memory ROM Smaller amount of memory stable when power off. Stores enough code to boot system

13 Computer Organization  Secondary storage unit  disks, tapes long-term, slow access, high capacity warehouse  Central Processing Unit (CPU): Microprocessor (Intel Pentium, Motorola power PC): fetches machine instructions from memory, executes them  Arithmetic and logic unit (ALU) calculations, comparisons  CU (Control Unit) coordinator, administrator,

14 Computer Architecture CPU Program Control Unit ALU MemoryI/O

15 What is a program ? A program is traditionally known as:  a sequence of instructions that can be executed by a computer to solve some problem.  In this course, we will learn to write our own programs to solve some very simple problems.

16 How do we write good programs ?

17 What is a programming language ?

18 What is Procedural programming ?

19 What is Object-Oriented programming ?

20 Processing

21

22

23 sketch  Each program is called a “sketch” in Processing. The top left play button starts your program which brings up a window (shown yellow here with a picture of a teddy bear). Since, many processing programs are meant to be animations, there is also a stop button beside the play button to stop the program. You should explore the Processing IDE (i.e., Integrated Development Environment) a little to get used to it. syntax JAVA  Processing uses the same syntax as JAVA. That means, Processing code looks almost exactly like JAVA code. So when you are programming in Processing, you are actually learning JAVA as well. However, Processing has been designed in a way that makes it easier to get you started because some of the overhead in getting your first program working is hidden.  As you may recall, Processing is a graphics-based language and therefore we will spend a lot of time and effort drawing various things on the screen. When drawing anything, it is important to specify where you want to draw.

24 The JAVA Programming Language JAVA is a very popular object-oriented programming language from SUN Microsystems. It has become a basis for new technologies such as: Enterprise Java Beans (EJB’s), Servlets and Java Server Pages (JSPs), etc. In addition, many packages have been added which extend the language to provide special features:  Java Media Framework (for video streaming, webcams, MP3 files, etc)  Java 3D (for 3D graphics)  J2ME (for wireless communications such as cell phones, PDAs)

25 Why java?

26 Writing a program in Processing  Use Java syntax.  In order to tell computer what to do, we have to use Instructions. They are called statements.  Each statement follow a specific syntax.  Each statement end with Semicolons ;  Compiling is the process of converting a program into instructions that can  be understood by the computer.

27  As you may recall, Processing is a graphics-based language and therefore we will spend a lot of time and effort drawing various things on the screen. When drawing anything, it is important to specify where you want to draw.

28

29

30

31

32

33

34 Colors in Processing

35 More graphical functions

36 Some important comments on java  Java is a case sensitive language.  Most of the library names start with capital letters.  In order to complete your code in netbeans you can use control + space keys.

37 Problem Solving

38

39 Understand the Problem

40 Formulation of Problem

41 Example

42 Develop and Algorithm

43

44

45

46

47 Write the program

48

49 Test the Program

50 Solution evaluation

51 Abstraction  Abstraction  Abstraction is the process of reducing or factoring out details that are not necessary in order to describe an algorithm

52

53 Algorithm efficiency  Algorithm efficiency is used to describe properties of an algorithm relating to how much of various types of resources it consumes. (Wikipedia)

54

55

56

57

58

59 Difference between print and println  The first line uses print while the second line uses println. When using just print, the next text to be printed will be immediately to the right of this text.  When using println, a line feed and carriage return is printed, which means that the text to follow will appear at the beginning of the next line of the console (i.e., output window).

60 Example:

61 QUESTIONS?


Download ppt "INTRODUCTION Introduction to Computer Science I - COMP 1005, 1405 Instructor : Behnam Hajian"

Similar presentations


Ads by Google