Exposure Java-A 2006 Chapter 1 Slides Introduction to Computer Science PowerPoint Presentation created by: Mr. John L. M. Schram From Materials Created by Mr. Leon Schram
Learning Computer Science
The “Nothing is Obvious Story” Imagine a young boy in the Amazon jungles. This boy has always lived in the jungle without any modern conveniences. He has never been in a city; he has never seen a television nor seen a book. Now imagine that for some unknown reason this young boy travels to Colorado in the Winter time. The little boy stands in a yard somewhere and watches the snow with bewilderment. He is astonished; he does not understand what is falling from the sky. Another little boy, about the same age, from Colorado, looks at the boy's behavior. The Colorado boy is confused, why is the boy acting so odd? Obviously it is snowing, so what is the big deal?
Bewilderment + Exposure = Obvious The Exposure Equation Bewilderment + Exposure = Obvious
Exposure in Extracurricular Activities Drill team performance Half-time band show Football Team blocking Basketball free throws Baseball batting
The Curious Exposure Discrepancy Students recognize that only continuous practice will result in a good showing at a brief performance or brief competition Many of the same students barely read or practice a topic once for an academic subject. It appears that preparation for a known, short performance requires practice, but preparation for life receives only minimal effort from many students.
Roller Coaster Emotions The majority of computer science assignments work or they do not work. This causes considerable emotions with most beginning students. Many students get very excited when a program works, and very depressed when many hours of effort result in nothing. Accept the fact that a computer is not intelligent and requires 100% correct information. Do not become angry with the computer, nor with yourself. Determine the discrepancy (small we always hope) and try again.
Learning Computer Science Read the assigned textbook pages before the lecture. Read the material again after the lecture. Listen closely to the lecture. Play with the computer. If program examples are used at your computer, make sure that you are at the same place as the lecture. Make sure that you get clarification in any area that is confusing before you take a test. Read lab assignments before arriving for a scheduled lab. Pay particularly close attention when a test is returned Ask questions, if you are confused with a lecture or lab. Please realize that cramming does not work with computer science!
Excessive Help Positive Help Kind of help a student gets to understand the required concepts, so that the student learns to do the assignment Excessive Help Kind of help a student uses to complete an assignment without learning the required concepts.
Excessive Help Catches Up: Lab Exercises Computer Lab Programming Tests Class quizzes Multiple Choice Tests
A Brief History of Computers
The Abacus 3000 B.C. The Abacus was originally invented in the Middle Eastern area. This rather amazing computing device is still very much used in many Asian countries today.
Napier's "Bones" 1617 A.D. John Napier used some bones marked with special scales to simplify arithmetic by using addition for multiplication.
The Slide Rule 1622 William Oughtred created the slide rule. This device allows sophisticated mathematical calculations, which was widely in use until around 1970.
Numerical Calculating Machine 1642 Blaise Pascal builds the first numerical calculating machine. This device works similar to the old car odometers and could perform addition and subtraction.
Jacquard's Loom 1805 Joseph Jacquard invents flexible cards that are punched with information in such a manner that it is possible to program how cloth will be weaved. It was one of the first examples of programming.
Analytical Engine 1833 Charles Babbage invents a machine that can read instructions from a sequence of punched cards. This becomes the first general purpose computing machine.
Programming 1842 Countess Ada Lovelace designs programs that work for Babbage's analytical machine. She is considered the mother of programming. Today a programming language is named after Ada.
Tabulating Machine 1884 Herman Hollerith invents a tabulating machine that records statistics for the U.S. Bureau of census. Hollerith starts a tabulating company, which after various name changes eventually becomes International Business Machines (IBM).
Colossus 1941-1944 This computer is developed in England in various stages and helps to decrypt the secret code message of German communication during Word War II.
Mark I 1944 This relay-based computer is developed by Harvard University and IBM. Grace Hopper, then a Navy Lieutenant, becomes the first programmer of the Mark I.
ENIAC 1946 The ENIAC (Electronic Numerical Integrator and Computer) is the first fully-electronic computer. The computer is two stories tall, weighs 80 tons, contains 19,000 vacuum tubes, and is programmed by walking inside the computer.
Integrated Circuit 1958 Jack Kilby, of Texas Instruments, at Richardson, Texas invents the planar transistor, which allows creation of integrated circuits and micro chips.
Altair 1975 Altair becomes the first personal computer. It is created by Ed Roberts and Bill Yates. The computer costs $397.00 and has storage for 256 bytes.
Apple II 1977 The Apple Computer Company is created and introduces the Apple II personal Computer. It becomes the first commercially successful personal computer.
VisiCalc 1979 Dan Bricklin created VisiCalc, a spreadsheet program, which becomes the first wide spread software to be sold.
WordStar 1979 MicroPro releases WordStar, which becomes the most popular word processing software program.
IBM PC 1981 IBM's entry into the personal computer market gives the personal computer a serious image as a true business computer and not some sophisticated electronic game playing machine.
MS-DOS 1981 Microsoft, an unknown little company run by Bill Gates, agrees to create the operating system for the IBM Personal Computer and becomes a company larger than IBM.
The Macintosh 1984 The "Mac" was the first commercially successful computer with the mouse/windows technology. The mouse technology was already developed earlier by Xerox Corporation.
Electronic Memory
Three Ways Where Computers Beat People Computers are faster. Computers are more accurate. Computers do not forget.
First Five Letters In Morse code A ▀ ▀▀▀ short - long B ▀▀▀ ▀ ▀ ▀ long - short - short - short C ▀▀▀ ▀ ▀▀▀ ▀ long - short - long - short D ▀▀▀ ▀ ▀ long - short - short E ▀ short
Electronic Memory off on 1
0-31 in Bases 10 & 2 Base 10 Base-2 16 10000 1 17 10001 2 10 18 10010 3 11 19 10011 4 100 20 10100 5 101 21 10101 6 110 22 10110 7 111 23 10111 8 1000 24 11000 9 1001 25 11001 1010 26 11010 1011 27 11011 12 1100 28 11100 13 1101 29 11101 14 1110 30 11110 15 1111 31 11111
Three Combinations of 8 Light Bulbs 01000001 (base-2) = 65 (base 10) or char A 1 01000010 (base-2) = 66 (base 10) or char B 1 01000011 (base-2) = 67 (base 10) or char C 1
Bits, Bytes & Codes Bit is a Binary digit that is either 0 (off) or 1 (on). 1 Nibble = 4 bits 1 Byte = 8 bits. 1 Byte has 256 different numerical combinations. 2 Bytes has 65,536 different numerical combinations. ASCII uses one byte to store one character. Unicode uses two bytes to store one character.
Number Systems
Counting in Other # Systems 0-15 Base 10 Base-2 Base 16 Base 5 0000 1 0001 2 0010 3 0011 4 0100 5 0101 10 6 0110 11 7 0111 12 8 1000 13 9 1001 14 1010 A 20 1011 B 21 1100 C 22 1101 D 23 1110 E 24 15 1111 F 30
Counting in Other # Systems 16-31 Base 10 Base-2 Base 16 Base 5 16 0001 0000 10 31 17 0001 0001 11 32 18 0001 0010 12 33 19 0001 0011 13 34 20 0001 0100 14 40 21 0001 0101 15 41 22 0001 0110 42 23 0001 0111 43 24 0001 1000 44 25 0001 1001 100 26 0001 1010 1A 101 27 0001 1011 1B 102 28 0001 1100 1C 103 29 0001 1101 1D 104 30 0001 1110 1E 110 0001 1111 1F 111
Motherboard & Computers Chips The main board with all the primary computer components. Has several computer chips attached: Read Only Memory (ROM) This chip stores permanent information for the computer. Random Access Memory (RAM) This chip stores temporary information for the computer. Central Processing Unit (CPU) This chip is the “brains” of the computer.
NOTE: Technically, a kilobyte is exactly 210 or 1024 bytes. Measuring Memory KB Kilo Byte 1 thousand bytes MB Mega Byte 1 million bytes GB Giga Byte 1 billion bytes TB Tera Byte 1 trillion bytes NOTE: Technically, a kilobyte is exactly 210 or 1024 bytes.
Secondary Storage Devices Since RAM is lost when the computer is turned off, files must be saved to some secondary storage device for later use.
Program Definition A program is a sequence of instructions that makes a computer perform a desired task. A programmer is a person who writes a program for a computer.
Programming in Machine Code Programming the first computers was an unbelievably difficult task. Individual vacuum tubes had to be switched on or off. Instructions were sequenced by physically plugging wires from one computer memory segment to another. Later computers allowed tape and cards to be used for program input. Still, thousands of 1s and 0s that had to be entered. Mistakes were very easily made, and very difficult to detect.
Programming in Assembly Language Every CPU instruction has a mnemonic name. For instance, mov AX,1234 is the instruction to place the value 1234 into the AX register. Uses hexadecimal (base-16) numbers rather than binary (base-2) numbers. There exists a unique relationship between base-2 and base-16 numbers. An assembler is used to translate the mnemonic commands into machine code.
The Relationship Between Hex & Binary Convert 7A1D9F16 to Binary 7 A 1 D 9 F 0111 1010 0001 1101 1001 1111 7A1D9F16 = 0111101000011101100111112 Convert 0111101000011101100111112 to Hex 0111101000011101100111112 = 7A1D9F16 Binary Hex 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 B 1100 C 1101 D 1110 E 1111 F
Programming Languages
Interpreters & Compilers Grace Hopper, a Navy lieutenant, was largely instrumental for developing translating programs that allow programming in a human-style language. Two types of translating programs were created: An interpreter translates a program one line at a time during execution. A compiler translates the entire program into a machine code file and then executes the file. The majority of today’s program languages use compilers for translators. Java, oddly enough, is both a compiled and an interpretive language. How this is possible will be explained soon.
Types of Languages High-Level Language Languages that are closer to human languages. Examples: BASIC, Pascal, COBOL, FORTRAN, PL/1, C, C++, Java Low-Level Language Languages that are very close to binary code. Examples: Machine Code and Assembly Language A translator (interpreter or compiler) translates a High-level language into a Low-Level language.
FORTRAN The first successful programming language -- released in 1956. FORTRAN stands for FORmula TRANslation Designed for the mathematics and scientific community. It could not handle the record processing required for the business world.
COBOL Created in 1960 (largely by Grace Hopper) for the business community and the armed forces. COBOL stands for COmmon Business Oriented Language. COBOL became extremely successful when the Department of Defense adopted COBOL as its official programming language.
PL/1 PL/1 stands for Programming Language 1 It tried to be a language for everybody by combining all of the Math features of FORTRAN with all of the business features of COBOL. The result was an extremely cumbersome language that never gained much popularity.
BASIC BASIC stands for Beginner All-purpose Symbolic Instructional Code Was designed for beginning college students. BASIC became the first popular program language for personal computers in the seventies. BASIC required little memory, and it was the only language that could initially be handled by the first micro computers.
Pascal Pascal was named after Blaise Pascal (the same guy who created Pascal’s Triangle). In the late seventies, early eighties, Pascal took a strong hold in the educational community. Pascal was developed by Niklaus Wirth, specifically for the purpose of teaching proper computer science programming techniques. For many years Pascal was the language taught in APCS1 & APCS2.
C and C++ The UNIX operating system was developed at the Bell laboratories and was written in several languages including BCPL or just plain B. A later version of the language was called C. A new era with a powerful programming technique was born called Object Oriented Programming (OOP). Bjarne Stroustrup combined the popularity of the existing C language with the demands for OOP and developed C++.
Java Released in 1995 by Sun Microsystems. Java is a Platform Independent Language. Platform Independent means that the language does not cause problems as programs are transported between different hardware and software platforms. Unlike C++, Java required you to use OOP which caused many universities to adopt it. This caused Java to be the official language for the APCS Exam starting in the 2003-2004 school year.
Networking
SneakerNet Early personal computers were not networked at all. Every computer was a stand-alone computer. Some computers were hooked up to printers and many others were not. If you needed to print something, and you were not directly connected to a printer, you saved your work to a floppy disk, put on your sneakers, and walked to the printing computer. Sharing files was done in the same way.
Peer-To-Peer Networks The first practical networks for personal computers were peer-to-peer networks. These are small groups of computers with a common purpose all connected to each other. These types of networks were frequently called Local Area Networks or LANs. Initially, the networks were true peer-to-peer networks. This means that every computer on the network was equal.
Client-Server Networks A server is a specialty computer that is connected to the LAN for one or more purposes. It services the other computers in the network which are called clients. Servers can be used for printing, logon authentications, permanent data storage and communication. Server Client Client Client
The Department of Defense The Internet has existed since the 1960s and has its origins in the "Cold War.“ During the Cold War there was a major concern about the country being paralyzed by a direct nuclear hit on the Pentagon. A means of communication had to be created that was capable to keep working regardless of damage created anywhere. This was the birth of the Internet. The Internet has no central location where all the control computers are located. Any part of the Internet can be damaged and all information will then travel around the damaged area. Many people confuse the World Wide Web with the Internet. WWW came out in the 1990s and is a PART of the Internet.
The Modern Internet Normally, businesses and schools have a series of LANs that all connect into a large network called an Intranet. An Intranet behaves like the Internet on a local business level. This promotes security, speed and saves cost. Now the moment a school, a business, your home, wants to be connected to the outside world and giant world-wide network known as the Internet, you have access to millions of lines of telecommunications. This will cost money and every person, every school, every business, who wants this access needs to use an Internet Service Provider or ISP. You pay a monthly fee to the ISP for the Internet connection. The amount of money you pay depends on the speed of your Internet connection.
Hardware & Software
Hardware Hardware are the physical pieces of computer equipment. This included the main computer system unit, as well as all of the peripherals (things that plug into the computer.)
Software Computer software provides instructions to a computer. The most important aspect of this course is to learn how to give correct and logical instructions to a computer with the help of a programming language. Software falls into two categories: System Software Application Software. Operating Systems like Windows and Linux are examples of System Software. Applications software runs an application on a computer. Examples of Application Software are Word, Excel, PowerPoint, Video Games, and the very programs that you will write in this course.