230 likes | 412 Views
CSC1401: Introductory Programming. Steve Cooper scooper@sju.edu http://www.sju.edu/~scooper. Overview. Course description (slides 3- 6) syllabus (see Handout) expectations tools Introductory Lecture (slides 7 - 23) What is a program? What is a programming language?
E N D
CSC1401:Introductory Programming Steve Cooper scooper@sju.edu http://www.sju.edu/~scooper
Overview • Course description (slides 3- 6) • syllabus (see Handout) • expectations • tools • Introductory Lecture (slides 7 - 23) • What is a program? • What is a programming language? • Introduction to Alice
CSC1401 • Introduction to writing computer programs • traditional • object-oriented • 3D animation programming • Pixar and Disney style (film, movie) • Interactive games (reasonably small)
CSC1401 - FS • An introductory course • No previous programming experience is required
Expectations • Come to class • Work with the text, handouts, and online content • Complete the exercises, assignments, and labs • Workouts; designed to prepare you for the exams • Do your own work on individual assignments; you may work with a partner on an assignment with prior permission
Tools • Textbook • Learning to Program with Alice • Other reading • handouts, online references • Software (available online, freeware) • Alice • Java
What is a program? • A program is a sequence of instructions that • tell the computer what to do • tell another human being what you want the computer to do • More formally, a program implements an algorithm. • Algorithm:a finite set of well-defined instructions for accomplishing some task Wikipedia
Program Tasks • Programs are written for various kinds of tasks (not mutually exclusive) • solve a problem • simulation • game • animation
What is a language? • A system for communicating. • Written languages use symbols (that is, characters) to build words. • Parts of Language • Vocabulary: The entire set of words in the language. • Syntax and grammar: The ways in which the words can be meaningfully combined • Semantics: The actual meaning of words and combinations of words Webopedia
Computer Languages • Human languages are natural languages. • Computers are not sophisticated enough to understand natural languages. • In mathematics, logic and computerscience, a formal language is a set of finite-length words (i.e. characterstrings) drawn from some finite alphabet, with carefully defined vocabulary, syntax, and semantics Wikipedia • There are many different kinds of computer languages, including machinelanguages, programminglanguages, and fourth-generationlanguages. Webopedia
Learning to write a program • A program is written using a programming language • We will learn to write programs using two languages • Alice • Java
Object Oriented Programming • Different programming languages support different styles of programming • In object-oriented programming, programmers can think of a program as instructions that tell interacting objects what to do • An object is a model of some artifact (product of civilization) that can interact with other objects
In this course… • We will learn how to • Initiate and control the interactions between objects to • solve problems • perform tasks • tell stories in animations • play games • Modify and build objects
Supporting Skills to Develop • Algorithmic Thinking and Expression • Being able to read and write in two formal languages • Alice (fourth-generation) • Java (high-level or third generation) • Abstraction: • Communicating complex ideas simply • Decompose problems logically • Appreciation of Elegance • Many ways to solve a problem, but some are more elegant than others
Introduction to Alice • Use the software from the CD or can download latest version from the web www.alice.org Alice is named in honor of Lewis Carroll’s Alice in Wonderland
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)
Demo: Getting started • Starting Alice • Load and run a world • What Alice Can Do (Examples) • Amusement Park (Examples) • Flight Simulator (Examples) • LightDemo (Examples) • Octopus (download) • Lake Skater (Examples)
Kinds of Animations • Two kinds of animations: • Movie • Passive user watches the animation • What Alice Can Do • LightDemo • Octopus • Interactive • Active user clicks on mouse, types a key on keyboard … • Actions of user are called events • Flight Simulator • Skater
Objects • An "object" is a model of an artifact • and can be identified as unique from other things • there can be multiple objects that are similar, but still unique • How is an object unique? • has a name • has properties: • width, height, color, location • can perform actions (methods): • associated actions it can perform • tasks it can carry out
Object Parts • Objects may be composed of parts (which are also objects)
Class • A class defines a particular kind of object • Objects are categorized into classes • Each object is an instance of the class. • All objects in a class have similar propertiesand generally can perform the same tasks. peter Person paul mary spike Dog scottie fluffy
Galleries • Classes (3D models) are found in the galleries • Local gallery (installed with the software) • Minimum or complete options • CD Gallery (only if CD is in the machine) • Web gallery
For next class • Activity • Launch Alice on your computer and run some of the example worlds. • Homework • Read Chapter 1.1 and pages 73 - 74 of the text