Concepts From Alice Switching to Java Copyright © 2006-2017 Curt Hill.

Slides:



Advertisements
Similar presentations
Chapter 1 Program Design
Advertisements

Week 4-5 Java Programming. Loops What is a loop? Loop is code that repeats itself a certain number of times There are two types of loops: For loop Used.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
Copyright © Curt Hill Turtles The beginning of media computation.
Copyright © Curt Hill First Window Builder Program Easy GUIs in Eclipse.
A Simple Quiz: Ask User Functions. By Lana Dyck under the direction of Professor Susan Rodger Duke University June 2009, added Part 2 July 2011.
Copyright © 2010 – MICS 2010, Curt Hill Instructor Tools: Test Data Generation Curt Hill Valley City State University.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC PROGRAMMING FUNDAMENTALS Bilal Munir Mughal 1 Chapter-8.
Copyright Curt Hill Variables What are they? Why do we need them?
Statement Level Flow of Control Iteration Structures Copyright © by Curt Hill.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6: Transition to Java Programming with Alice and Java First Edition.
Copyright Curt Hill The C/C++ switch Statement A multi-path decision statement.
Copyright © Curt Hill Loop Types and Construction Logical types and construction hints.
Copyright © Curt Hill The Compound Statement C-Family Languages and Scope.
Object Oriented Programming Criteria: P2 Date: 07/10/15 Name: Thomas Jazwinski.
Copyright © Curt Hill Flow of Control A Quick Overview.
Copyright © Curt Hill Simple I/O Input and Output using the System and Scanner Objects.
The for Statement A most versatile loop
Copyright © 2016 Curt Hill Static Code Analysis What it is and does.
HTML Again GUI Items Originally HTML 4 Copyright © Curt Hill.
Programming Right from the Start with Visual Basic .NET 1/e
C++ LANGUAGE MULTIPLE CHOICE QUESTION
HTML Simple Introduction
Functions + Overloading + Scope
Flow of Control An Overview
Part of the Assembler Language Programmers Toolbox
Sourcing Event Tool Kit Multiline Sourcing, Market Baskets and Bundles
Chapter 8: Writing Graphical User Interfaces
Event loops 16-Jun-18.
Putting Objects in Motion
Unified Modeling Language
Chapter 7 Part 1 Edited by JJ Shepherd
Chapter Eleven Handling Events.
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Java Programming: Guided Learning with Early Objects
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
Organizing common actions
Refining our Animations
Doing things more than once
Chapter 6 Methods: A Deeper Look
The Rapid Application Development Paradigm
Unit 1: Introduction Lesson 1: PArts of a java program
Event loops.
Arrays in Java What, why and how Copyright Curt Hill.
HAPPY NEW YEAR! Lesson 7: If-statements unplugged
Compound Statements A Quick Overview
Arrays
Concurrency in Java Last Updated: Fall 2010 Paul Ammann SWE 619.
A Robust Data Structure
Introduction to Problem Solving and Control Statements
Threads Chapter 4.
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Copyright © – Curt Hill Bash Flow of Control Copyright © – Curt Hill.
Using Lists and Functions to Create Dialogue
Java Programming Review 1
The Java switch Statement
PowerShell Flow of Control Copyright © 2016 – Curt Hill.
Event loops 8-Apr-19.
Communication between modules, cohesion and coupling
Classes, Objects and Methods
Java Looking at our first console application in Eclipse
MIS 3200 – Unit 5.1 Iteration (looping) Working with List Items
Event loops.
Event loops.
Event loops 19-Aug-19.
The beginning of media computation Followed by a demo
3.0 - Design A software design specifies how a program will accomplish its requirements A design includes one or more algorithms to accomplish its goal.
While and Do While Syntax, semantics and examples
Presentation transcript:

Concepts From Alice Switching to Java Copyright © 2006-2017 Curt Hill

Concepts We Have Seen Concepts Objects Looping statements Blocks Concurrency Variables Bugs We should have seen the equivalent Java code for Alice statements Copyright © 2006-2017 Curt Hill

The Process Programming is bossing the machine around Making it do what you want When it does not do what you intended it is a bug A program is a sequence of statements that accomplish this There are many little details that must be right for good results Copyright © 2006-2017 Curt Hill

Objects A self contained piece of code Methods, properties, events An object may be composed of smaller objects We may do things to the larger object We may also do things to the contained objects Copyright © 2006-2017 Curt Hill

More on Objects Alice objects are obtained from gallery We may drag in an object more than once In Java we have classes and objects An object being an instance of a class The Java library is much larger than the Alice gallery Often we specify the portion of the library that contains the class we need Copyright © 2006-2017 Curt Hill

Variables An item that may contain a value Two kinds in Java Primitive types contain simple things like an integer or character Similar to Alice parameter values Objects Contains values and methods Values may be primitive or other objects Copyright © 2006-2017 Curt Hill

Decision statements Java decision statements are actually easier to create than those of Alice Type rather than drag and drop Two types of decision If Similar to Alice Based on boolean Switch case Multi-way decision Copyright © 2006-2017 Curt Hill

Looping statements There are three loops in Java compared to two in Alice The for is the counting loop Most similar to the Loop of Alice The while of Java is similar to the Alice while The do of Java is a trailing decision loop There are no trailing decision loops in Alice Copyright © 2006-2017 Curt Hill

Blocks The statements of a Do Together, Do In Order, If, Loop etc. form a block A block is a container that holds one or more statements Bundles these together as one The Java block is just a pair of braces { } It is stronger than that of Alice Copyright © 2006-2017 Curt Hill

Concurrency Java handles concurrency very well for a language It is not nearly as easy to use as in Alice It is unlikely that we will cover in this class The important terms in Java are: thread runnable interface Copyright © 2006-2017 Curt Hill

Event Handling An event is some action that occurs at an unpredictable time A user types a key Event handling is the action that a program does in response to the event We will likely see event handling in regards to a user clicking a button in Java Copyright © 2006-2017 Curt Hill

Environment In early programming languages the entire program was typed Today we usually use a combination Drag and drop Used to design the window Initialize event handling Typing Enter the central logic of the program Copyright © 2006-2017 Curt Hill

Java Environment There are many, some are even free We will use Eclipse Java SE You should download this soon Even as you are still working on the Alice program Copyright © 2006-2017 Curt Hill

Finally This concludes our short detour through Alice Alice shows all the features of a general purpose language Since you are able to create Alice programs you are also able to create Java programs Even if it is not quite as fun or easy Copyright © 2006-2017 Curt Hill