Class 13 - From Alice to Java Matthew Hashim Click to edit...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
12/4/09 Click to edit Master subtitle style From Alice to Java Matthew Hashim 10/6/2009 11
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12/4/09 Goals for Today n Write some first Java programs n Learn the basics of the Eclipse Integrated Development Environment (IDE) n Begin making the transition from Alice to Java 22
Background image of page 2
12/4/09 From Alice to Java n The four steps of computer programming ¨ 1. Designing the program ¨ 2. Writing the program ¨ 3. Running the program ¨ 4. Testing the program n Program development using Alice ¨ Step 1: Write user stories and construct storyboards ¨ Step 2: Add objects to world, animate with messages ¨ Step 3: Press the Play button ¨ Step 4: Scrutinize a number of executions 33
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12/4/09 From Alice to Java (continued) n Benefits of program development using Alice ¨ 3D graphics let you visualize programming concepts ¨ Drag-and-drop coding reduces syntax errors n Benefits of program development using Java ¨ Build reusable classes ¨ Run Java programs across various platforms ¨ Build applets to make Web pages interactive 44
Background image of page 4
12/4/09 Designing a First Java Program n Use many techniques learned in Alice n First step: write a user story to help setup structure n User story for dollars-to-euros currency conversion ¨ Query user for dollar amount to convert to euros ¨ Read the dollar amount from the user ¨ Query user for euros-per-dollar exchange rate ¨ Read euros-per-dollar exchange rate ¨ Compute corresponding number of euros ¨ Display dollar and (computed euros values) 55
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12/4/09 The Object List n Review: class is blueprint for an object n Procedure for isolating objects in the user story ¨ Identify the noun phrases (primary object indicators) ¨ Create a table listing nouns, values stored, and names n The name should also be a noun (or noun phrase) n The name should be descriptive ¨ If no Java type matches the value, define a class n Naming convention ¨ Class: capitalize each word in the name ¨ Variable or method: capitalize each word except first 66
Background image of page 6
12/4/09 The Object List (continued) 77
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12/4/09 The Operations List n Operations correspond to verb phrases in user story n Procedure for isolating verbs in the user story ¨ Identify the verb phrases (primary operation indicators) ¨ Create a table listing verbs and matching operations n There are five verb phrases in the user story 88
Background image of page 8
12/4/09 The Operations List (continued) 99
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12/4/09 The Algorithm n Algorithm: sequence of steps that solve a problem n Algorithm for converting dollars to euros ¨ 1. Display "How many dollars do you want to
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 39

Class 13 - From Alice to Java Matthew Hashim Click to edit...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online