Announcements - PowerPoint PPT Presentation

About This Presentation
Title:

Announcements

Description:

... value and moves cursor to the next line. Lecture 4: For ... Band: The Killers, Album: Hot Fuss. public class Song. public static void main (String [] args) ... – PowerPoint PPT presentation

Number of Views:67
Avg rating:3.0/5.0
Slides: 13
Provided by: CSCF
Category:

less

Transcript and Presenter's Notes

Title: Announcements


1
Announcements Review
  • Last Time
  • Compilation
  • Scaffolding
  • print()
  • displays a value
  • println()
  • displays a value and moves cursor to the next
    line
  • Announcements
  • Examples posted after lecture on schedule
  • Discussion Section exercises on line before 9am
    Tuesdays
  • Lab 2 Due Thursday 10pm

2
Today
  • More on Beauty
  • Analogy Formatting Paragraphs
  • Sequencing
  • Analogy a well constructed essay
  • Note on punctuation end your statements
  • Repetition (i for iteration)
  • for (int i 0 i
  • // your code here

3
Beauty
  • / Kathryn S McKinley
  • September 2005
  • file Song.java - a few lines from a good
    song
  • Song All These Things That Ive Done
  • Band The Killers, Album Hot Fuss
  • /
  • public class Song
  • public static void main (String args)
  • System.out.println(You are going to bring
    yourself down)
  • System.out.println(Ive got soul, but
    Im not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Yah yah, you got to
    help me out.)

4
Im Ugly
  • / Kathryn S McKinley
  • September 2005
  • file Song.java - a few lines from a good
    song
  • Song All These Things That Ive Done
  • Band The Killers, Album Hot Fuss
  • /
  • public class Song
  • public static void main (String args)
  • System.out.println(You are going to bring
    yourself down)
  • System.out.println(Ive got soul, but
    Im not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Yah yah, you
    got to help me out.)

5
Paragraphs
  • // song lines
  • System.out.println(You are going to bring
    yourself down)
  • System.out.println(Ive got soul, but Im not
    a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Yah yah, you got to
    help me out.)

6
Paragraphs
  • // verse
  • System.out.println(You are going to bring
    yourself down)
  • //chorus
  • System.out.println(Ive got soul, but Im not
    a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • //verse
  • System.out.println(Yah yah, you got to
    help me out.)

7
Can we do better?
  • // verse
  • System.out.println(You are going to bring
    yourself down.)
  • //chorus
  • System.out.println(Ive got soul, but Im not
    a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • //verse
  • System.out.println(Yah yah, you got to
    help me out.)

8
Yes!
  • // verse
  • System.out.println(You are going to bring
    yourself down.)
  • //chorus
  • for (int i 0 i
  • System.out.println(Ive got soul, but Im
    not a soldier. )
  • //verse
  • System.out.println(Yah yah, you got to help
    me out.)

9
For Definite Loop
  • Three parts
  • for (i 0 i
  • // loop body
  • Initialization
  • Test
  • Increment

10
For Definite Loop
  • Three parts
  • for (int i 0 i
  • // loop body in here
  • Initialization - int i 0
  • one time only
  • Test - if i
  • every time
  • Increment - i add 1 to the value of I
  • every time

11
BlueJ Examples

12
Questions?
Write a Comment
User Comments (0)
About PowerShow.com