1 / 23

Chapter 1—Introduction

Java. The Art and Science of. An Introduction. to Computer Science. ERIC S. ROBERTS. C H A P T E R 1. Introduction. [The Analytical Engine offers] a new, a vast, and a powerful language . . . for the purposes of mankind. —Augusta Ada Byron, Lady Lovelace, 1843. Chapter 1—Introduction.

Download Presentation

Chapter 1—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. Java The Art and Science of An Introduction to Computer Science ERIC S. ROBERTS C H A P T E R 1 Introduction [The Analytical Engine offers] a new, a vast, and a powerful language . . . for the purposes of mankind. —Augusta Ada Byron, Lady Lovelace, 1843 Chapter 1—Introduction CS101 @ Özyeğin University Slides are adapted from the originals available at http://www-cs-faculty.stanford.edu/~eroberts/books/ArtAndScienceOfJava/

  2. 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?

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

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

  5. Eniac [http://ftp.arl.mil/ftp/historic-computers]

  6. Components of a Computer • Hardware: Physical parts. Tangible. • Software: Programs. Abstract, intangible. • Combination of hardware and software makes computation possible.

  7. A Brief Tour of Computer Hardware bus CPU secondary network storage I/O devices memory

  8. Central Processing Unit • “The Brain” • Actual computation and coordination of the entire computer • May be more than one: Multiprocessor • May have more than one computation units: Multicore

  9. Memory • Retains data • Both program data and program itself • Volatile: Data is lost when power is off. • RAM (Random Access Memory): Allows the program to use the contents of any memory cell at any time.

  10. Secondary Storage • Retains data • Long-term. High capacity. • Persistent: Data is preserved when power is off. • CD, DVD, Flash drive, tape, harddisk.

  11. Input • Receive data from input devices

  12. Output • Pass data to output devices

  13. Network • Connection to other computers. • Internet: Vast collection of computers throughout the world that are connected together by communication lines that allow them to share data and programs.

  14. From Amazon.com

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

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

  17. A simple algorithm for presentation Start Slide visible? No Control the projector Control the computer

  18. A simple algorithm for presentation Start Yes Slide visible? Present the content No questions? Control the projector Yes Control the computer Answer the question

  19. A simple algorithm for presentation Start Switch to the next slide Yes Slide visible? Present the content No No No questions? Last slide? Control the projector Yes Yes Control the computer Answer the question End

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

  21. Algorithm as a simple program similar to keywords of a programming language A line of code in the program Numbered lines of code 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

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

More Related