Chapter 2 Java in 30 minutes

Slides:



Advertisements
Similar presentations
Control Structures.
Advertisements

½ hour Chapter 2 Java in 30 minutes 1. 2 Rationale ½ hour Teaching a computer language like a logical system is possible. But not necessarily helpful.
CS 106 Introduction to Computer Science I 02 / 18 / 2008 Instructor: Michael Eckmann.
Tutorial #7 Flowcharts (reprise) Program Design. Introduction We mentioned it already, that if we thing of an analyst as being analogous to an architect,
Why Program? CSE111 – Great ideas in Computer Science Clearly programming fits here Programming is a Great Idea in Computer Science. It has allowed computers.
June 10, 2015ICS102: while & do-while1 while and do-while Statements.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 4 – C Program Control Outline 4.1Introduction.
Chapter 5: Control Structures II (Repetition)
Repetition Statements repeat block of code until a condition is satisfied also called loops Java supports 3 kinds of loops: while statement – repeats a.
COMP 14 Introduction to Programming Miguel A. Otaduy May 18, 2004.
Loops – While, Do, For Repetition Statements Introduction to Arrays
Computer Programming 1 Repetition. Computer Programming 2 Objectives Repetition structures Study while and do loops Examine for loops A practical example.
Loops Repetition Statements. Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional.
© 2004 Pearson Addison-Wesley. All rights reserved5-1 Iterations/ Loops The while Statement Other Repetition Statements.
Flow of Control Loops – Chapter 3.2. Java Loop Statements: Outline the while Statement the do-while Statement the for Statement.
Chapter 4 Control Structure: Loop Knowledge: Understand the various concepts of loop control structure Skill: Be able to develop a program involving loop.
ECE122 L9: While loops March 1, 2007 ECE 122 Engineering Problem Solving with Java Lecture 9 While Loops.
Chapter 4: Control Structures II
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Summary and Exam COMP 102.
Chapter 4: Looping. Resource: Starting Out with C++, Third Edition, Tony Gaddis 5.1 The Increment and Decrement Operators ++ and -- are operators that.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
CS100J Spring 2006 CS100J: 11 weeks of programming using Java and 2 weeks using Matlab. David Gries is teaching CS100J. Graeme Bailey is teaching a special.
COMPUTER PROGRAMMING I 5.05 Apply Looping Structures.
Do-while and for Loops Opening Discussion zWhat did we talk about last class? zAt the end of last class I asked you to write a loop that would.
Program Flow Control - Looping Addis Ababa Institute of Technology Yared Semu April 2012.
Chapter 4 Grouping Objects. Flexible Sized Collections  When writing a program, we often need to be able to group objects into collections  It is typical.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 5: Introduction to C: More Control Flow.
CSE 425: Control Flow I Categories of Control Flow Constructs Sequencing –order of expressions and statements Selection –if, else, switch Iteration –loops.
1 CS1100 Fall Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems CS100J:
Introduction Copyright © Software Carpentry This work is licensed under the Creative Commons Attribution License See
Digesting a big problem ONE BYTE AT A TIME. Quiz YOU WILL WORK WITH YOUR PARTNER (LAB PARTNER NOT FULL TEAM). FOR SOLOISTS OR THOSE WHOSE PARTNER IS NOT.
CONTROL STRUCTURE Chapter 3. CONTROL STRUCTURES ONE-WAY SELECTION Syntax: if (expression) statement Expression referred to as decision maker. Statement.
INVITATION TO Computer Science 1 11 Chapter 2 The Algorithmic Foundations of Computer Science.
1 CS100J Spring Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems.
Chad’s C++ Tutorial Demo Outline. 1. What is C++? C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for.
Loops ( while and for ) CSE 1310 – Introduction to Computers and Programming Alexandra Stefan 1.
Conditional Statements A conditional statement lets us choose which statement will be executed next Conditional statements give us the power to make basic.
Loop Design What goes into coding a loop. Considerations for Loop Design ● There are basically two kinds of loops: ● Those that form some accumulated.
CS 106 Introduction to Computer Science I 02 / 15 / 2008 Instructor: Michael Eckmann.
Computer Engineering Department Islamic University of Gaza
Chapter 4 – C Program Control
Chapter 7 User-Defined Methods.
CS161 Introduction to Computer Science
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
CiS 260: App Dev I Chapter 4: Control Structures II.
Chapter 8: Control Structures
While loops The while loop executes the statement over and over as long as the boolean expression is true. The expression is evaluated first, so the statement.
Iteration with While You can say that again.
Outline Altering flow of control Boolean expressions
Sometimes Turtle Feels Upset.
Introduction to pseudocode
Number and String Operations
Introduction to Object-Oriented Programming with Java--Wu
Java Programming Arrays
Chapter 4 - Program Control
Algorithm Discovery and Design
Exercise 1 Declare a constant of type int called SIZE and initialize it to value 10 Declare two int arrays of size “SIZE” Assume that those int arrays.
int [] scores = new int [10];
Java Review Most of these slides are based on
Programming Control Structures with JavaScript Part 2
Review for Test1.
Programming Control Structures
Fundamental Programming
Introduction to Computer Science
Midterm Review October 23, 2006 ComS 207: Programming I (in Java)
Repetition Structures
Week 7 - Monday CS 121.
Building Java Programs
Presentation transcript:

Chapter 2 Java in 30 minutes ½ hour

Teaching a computer language like a logical system is possible. Rationale Teaching a computer language like a logical system is possible. But not necessarily helpful. Everyone has studied a computer language so I can make some assumptions. Rapid introduction of the important syntax. (Feel free to interrupt with questions) Then I go over things in more detail, but I can refer to things only covered briefly and you will have least have seen them. Will assume you learn the syntax by practising. Course more about language idioms You understand what computer languages are about ½ hour

Primitives ½ hour

Variables ½ hour

Arithmetic ½ hour

Mathematical Expressions Provided by library functions Math. Maths Mathematical Expressions Provided by library functions Math. To look at the full documentation https://docs.oracle.com/javase/8/ More about libraries later tutorials documentation ½ hour

Documentation ½ hour

Mathematical Expressions Provided by library functions Math. Maths Mathematical Expressions Provided by library functions Math. ½ hour

Choice ½ hour

Choices ½ hour

Again ½ hour

. and again ½ hour Iteration – doing something more than once For loops often step through arrays OR “for values in measurement” Deciding not to do it continue; skips the rest of the loop and goes to the next value Finishing early break; ends the loop double[] measurements; double sum = 0.0; double average; for (int pnt=0; pnt< measurements.length;pnt++){ sum += measurements[pnt]; } average = sum/(double)measurements.length; for (double values: measurements) { sum += measurements[pnt]; } Good idiom – clear what you are doing ½ hour

Class.. ½ hour

Saying Hi ½ hour

In a nutshell ½ hour

Alone ½ hour

Lets talk ½ hour

½ hour

The sins of the fathers .. ½ hour

….. Now for the details ………………….. ½ hour