1 / 61

Introduction

Introduction. Instructor : Behnam Hajian bhajian@scs.carleton.ca. Introduction to Computer Science I - COMP 1005, 1405. Attention: A large amount of material in this set of slides has gotten from course notes prepared by Dr. Mark Lanthier. Objectives and syllabus.

slade
Télécharger la présentation

Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  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 Lectures: • Monday&Wednesday14:35 PM – 15:55 PM@ 103Steacie Building (SC).

  7. Course information Office hours: • Monday & Wednesday 4PM - 5 PM @ HP 5331 TextBook: • Course notes of Introduction to Computer Science 1mainained 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, gamesand 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. 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

  12. 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,

  13. Computer Architecture CPU Memory I/O Program Control Unit ALU

  14. 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.

  15. How do we write good programs ?

  16. What is a programming language ?

  17. What is Procedural programming ?

  18. What is Object-Oriented programming ?

  19. Processing

  20. 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. • Processing uses the same syntaxas 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.

  21. 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)

  22. Why java?

  23. 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.

  24. 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.

  25. Colors in Processing

  26. More graphical functions

  27. 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.

  28. Problem Solving

  29. Understand the Problem

  30. Formulation of Problem

  31. Example

  32. Develop and Algorithm

  33. Write the program

  34. Test the Program

  35. Solution evaluation

More Related