610 likes | 697 Views
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.
E N D
Introduction Instructor : BehnamHajian 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 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.
Where are you? Where you are? What you learn?
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
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).
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/
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
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 ...
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.
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
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,
Computer Architecture CPU Memory I/O Program Control Unit ALU
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.
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.
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)
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.
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.
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.