1 / 48

John Magee (jmagee@clarku)

John Magee (jmagee@clarku.edu). Welcome to CS120 Fall 2012. Welcome to CS120. Computing is ubiquitous Daily life, news, eCommerce… Sciences and engineering fields Social sciences, humanity, Arts, music, sports Education …. Computing.

jmar
Download Presentation

John Magee (jmagee@clarku)

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. John Magee(jmagee@clarku.edu) Welcome to CS120 Fall 2012

  2. Welcome to CS120 • Computing is ubiquitous • Daily life, news, eCommerce… • Sciences and engineering fields • Social sciences, humanity, • Arts, music, sports • Education • …

  3. Computing • One core objective of computing is efficient problem solving • Computing shares common methodologies with other fields Given a problem, how to • Understand it, formulate it, make hypotheses… • Many computing problems come from other fields • Design a solution • strategies for big problems, such as divide and conquer • Implement a solution • Should be done in a systematic, disciplined fashion • Test a solution • Revise, improve…

  4. CS120 • Object-oriented programming • Graphics/animation-based problems • Alice: A 3D animation language • Java: an Eventful Approach • Main topics • Methods • Variables and functions • Control structures • Lists and Arrays • Events • Classes

  5. Why Learn Programming? • Programming is a challenging and intellectually engaging experience. • Programming is a part of computer science, and is therefore important to anyone interested in becoming a computer professional.

  6. Why Learn Programming? • Computers have become commonplace in our society, and understanding their strengths and limitations requires an understanding of programming. • Programming can be a lot of fun. • Programming is a skill that can pay the bills. Very well.

  7. About Learning to Program Pre-requisites This is a first course in computer science. There are no formal pre-requisites. Some informal pre-req’s: • using email, browsing the web • copying and pasting text • some high-school level algebra Time Anyone can be successful at learning programming. Decent results, however, take a lot of time.

  8. How do we get there? Lectures Teaching Labs Weekly Homeworks Projects Midterm Written Exam and Practical Exam 9

  9. Expectations Attendance This is not a correspondence course. Participation Questions and discussion are what makes the class interesting. 9

  10. Administrative Questions? 9

  11. What You’ll Learn Today • What is computer science? • What is a computer? • What are hardware and software? • How can computers learn new tricks? • What is Programming?

  12. What is Computer Science?

  13. What is CS? The fundamental ideas of CS are: • Algorithms • Protocols • Encoding Information • Abstraction

  14. Flashlight Messaging Imagine you are 10 years old, in 1980... Your best friend lives next door. You want to send messages at night. You each have a flashlight. What do you do?

  15. ABC means 123 13 5 5 20 13 5 1 20 19 20 1 18 2 21 3 11 19 (Meet me at Starbucks)

  16. Numbered Code Replace each character with a number… Coded Message Example: 13 5 5 20 13 5 1 20 19 20 1 18 2 21 3 11 19 Encoding is about converting data into a coded form. Decoding is about converting from coded to normal form.

  17. Algorithm An algorithm is a sequence of clear and precise step-by-step instructions for solving a problem in a finite amount of time.

  18. Protocols A protocol is a set of rules governing the exchange or transmission of data between devices.

  19. The Braille Encoding Scheme Each character is up to 6 dots. Each dot is either on or off. Invented by Louis Braille (1809-1852).

  20. What are we looking at?

  21. No, this is the matrix!

  22. What is this?

  23. Your web browser interprets the coded data (1s and 0s) and renders the Facebook webpage.

  24. Abstraction Abstraction is about hiding unnecessary details and retaining only the relevant information. Eg. “Tie your shoe” “Drive a car”

  25. Encoding/Decoding The binary coded data (1s and 0s) is what your web browser interprets as the Facebook webpage. How? The digital computer is a machine which encodes, processes, and decodes data.

  26. Data and Information Data is a fact pattern: Information is how we interpret that pattern:

  27. What is a Computer? What is a computer, anyway? A computer takes an input, applies a process, and produces an output. Give some examples: 2

  28. What is a Computer?

  29. Hardware 3

  30. Software 3

  31. Early History of Computing Joseph Jacquard (1801) Jacquard’s Loom, the punched card

  32. Harvard Mark I IBM Archives

  33. First Computer Bug Log of first computer bug, discovered by Grace Hopper, 1945 A Computer Science Pioneer, she later wrote the first Compiler.

  34. Programmability • What tricks does your computer do? • Web browsing, email, instant messenger • Play games • Watch movies, organize photos • Word processing, spreadsheets, database • Programmability is the ability to give a general-purpose computer instructions so that it can perform new tasks. 3

  35. Programming Languages A program is a sequence of instructions. Spock: Computer. This is a Class-A compulsory directive. Compute, to the last digit, the value of pi. Computers are not very good at understanding natural languages • Ambiguity and imprecision • Dialects, accents, etc

  36. Programming Languages Computer languages are exact and unambiguous. Programming is the process of encoding our ideas for the computer: • Syntax (form) • Semantics (meaning) Popular programming languages: • BASIC, C++, Java, Perl, Python

  37. Machine Language Computing hardware performs only a small set of concrete operations, which are created in circuitry: load the number from memory location 2001 into the CPU load the number from memory location 2002 into the CPU add the two numbers in the CPU store the result into location 2003 These instructions must be provided to the CPU as binary notation (1s and 0s), called machine language

  38. High Level Languages Java is a high-level language c = a + b High level languages are more natural for us to understand, but need to be translated into the machine language for execution.

  39. Alice • A modern programming tool • 3-D graphics • 3-D models of objects • Animation • Objects can be made to move around the virtual world (a video game or simulation implemented in 3-D) • Two kinds of animations: • Movie: passive user watches the animation • Interactive: active user clicks on mouse, types a key on keyboard … • Actions of user are called events

  40. Getting and Running Alice • Alice software is freely distributed • Downloading Alice • Go to the website: http://www.alice.org • Click the link Get Alice 2.2 • Click download link specific to your operating system • Save Alice.zip (or Alice.dmg) to your PC • Installing and running Alice • Extract Alice from Alice.zip (or Alice.dmg) file • Create desktop shortcut (alias) to Alice.exe • Double-click Alice icon to launch Alice application

  41. The Alice Tutorials (continued) Go through the tutorials to learn the basics of Alice

  42. Alice • Drag-and-drop based programming • Major advantage: preventing syntax errors • Limitations • Restricted editing • Restricted reusing • Statement resusable within a method (but not statements) • Clipboards available for copying and pasting statements between methods of a class (but not all statements) • Saving a object (with newly defined methods) as a class for using in other worlds • Objects need to be pre-created (inconv. for arrays)

  43. User Stories • Contain • Basic description of what happens when program runs • Nouns in story (Alice, the White Rabbit) correspond to objects • Verbs correspond to actions, responses to messages • Chronological flow describes the sequence of the actions When the program begins, Alice and the White Rabbit are facing each other, Alice on the left and the White Rabbit on the right. Alice turns her head and then greets us. The White Rabbit also turns and then greets us. Alice and the White Rabbit introduce themselves. Simultaneously, Alice and the White Rabbit say “Welcome to our world.” Alice in Action with Java

  44. User Story and Story Board A numbered sequence of objects and actions 1. Alice turns her head toward the user 2. Alice greets the user 3. The white rabbit turns toward the user 4. The white rabbit greets the user 5. Alice introduces herself 6. The white rabbit introduces himself 7. Simultaneously, Alice and the white rabbit say “Welcome to our world.” Alice in Action with Java

  45. Program Design • For a given user story • plan scents and shots • Scene: a piece of the story usually set in one location • Shot: part of scene told with camera in one position • Create storyboards Alice in Action with Java

  46. Topics in CS120 • Eventful Java (tentative) • Events • Primitive types • Control Structures • Classes • Arrays • (Animation ?)

  47. What You Learned Today • Computer Science is… • A Computer is… • Hardware vs. Software • Programmability • Programming Languages • Machine language vs. high level • Introducing Alice and Java

  48. Announcements and To Do List • Visit the course web page • Download Alice 2.2 • Do the tutorials • Readings: • Alice in Action, Chapter 1

More Related