Presentation on theme: "Chapter 1—Introduction Introduction C H A P T E R 1 [The Analytical Engine offers] a new, a vast, and a powerful language... for the purposes of mankind."— Presentation transcript:
Chapter 1—Introduction Introduction C H A P T E R 1 [The Analytical Engine offers] a new, a vast, and a powerful language... for the purposes of mankind. —Augusta Ada Byron, Lady Lovelace, 1843 The Art and Science of An Introduction to Computer Science ERIC S. ROBERTS Java CS101 @ Özyeğin University Slides are adapted from the originals available at http://www-cs-faculty.stanford.edu/~eroberts/books/ArtAndScienceOfJava/
What is Computer Science? In its classical use, science refers to the study of natural phenomena. Many people imagine that computer science is the study of computers as artifacts and wonder how that can be a science. Car science? Refrigerator engineering?
What is Computer Science? Computer science has more to do with the study of problem solving in which the solutions happen to use computers. Computing/Computation Science? Computer science draws on a range of intellectual traditions that includes aspects of mathematics, classical science, and engineering. Computer science plays an increasingly important role in other disciplines: –Biology. Computers made it possible to map the human genome. –Economics. Computers enable the creation of better economic models. –Psychology. Artificial intelligence helps us to understand the brain. –Environment. Climate models require modern computing technology. –Literature. Computerized analysis helps resolve disputed authorship. –and most everything else...
Computer From Wikipedia: A computer is a programmable machine designed to carry out a sequence of arithmetic or logical operations. The particular sequence of operations can be changed readily, allowing the computer to solve more than one kind of problem.
Algorithms Much of computer science involves the study of algorithms. A procedure/strategy for solving a problem. Derived from the name of the Persian mathematician al-Khwarizmi, who wrote the book Kitab al jabr w’al-muqabala.
Algorithms To meet its more formal definition, an algorithm must be: –Clearly and unambiguously defined. –Effective, in the sense that its steps are executable. –Bad: “multiply r by the exact value of π”. –Finite, in the sense that it terminates after a bounded number of steps. –There may be more than one algorithm to solve a problem. –Complexity of the algorithm plays a crucial role in which one to use.
A simple algorithm for presentation Slide visible? Control the projector Control the computer Start No
A simple algorithm for presentation Slide visible? Control the projector Control the computer Present the content questions? Answer the question Start No Yes
A simple algorithm for presentation Slide visible? Control the projector Control the computer Present the content Last slide? questions? Answer the question Switch to the next slide Start End No Yes No Yes No Yes
Algorithm as a simple program 01.REPEAT until the last slide 02.IF slide is visible 03.Present the content 04.ELSE 05. Control the projector 06.Control the computer 07.RETURN TO step #02 08. REPEAT for each question 09.Answer the question 10. SWITCH to next slide
01.REPEAT until the last slide 02.IF slide is visible 03.Present the content 04.ELSE 05. Control the projector 06.Control the computer 07.RETURN TO step #02 08. REPEAT for each question 09.Answer the question 10. SWITCH to next slide Algorithm as a simple program similar to keywords of a programming language Numbered lines of code A line of code in the program
Java and the World-Wide Web Part of Java’s success comes from the fact that it is the first language specifically designed to take advantage of the power of the World-Wide Web, which came into prominence shortly before Java’s release in 1995. In addition to more traditional application programs, Java makes it possible to write small interactive programs called applets that run under the control of a web browser. The programs that you will learn to write in this book run as either applications or applets, which means that you can easily share them on the web.