APCS Unit 8 - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

APCS Unit 8

Description:

Warm-Up: Find the output to the following code segments: String state = 'Mississippi' ... Immutability of Strings. H. Comparing Strings. Ch29HomeworkAssign Set #3: ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 12
Provided by: mikerem
Category:

less

Transcript and Presenter's Notes

Title: APCS Unit 8


1
APCS Unit 8
A copy of this file is in the share drive/Unit8
  • Strings

2
Agenda/Objectives 10-9
  • Turn In
  • Bank and BankTester java files
  • PermutationGenerator with Test java files
  • Warm-Up Find the output to the following code
    segments
  • String state "Mississippi"
  • int len state.length()
  • char ch state.charAt(8)
  • String stub "ssip"
  • int index1 state.indexOf(stub)
  • int index2 state.indexOf('s')
  • System.out.println("The length of " state "
    is " len
  • " characters")
  • System.out.println("The character at index 8 is
    " ch)
  • System.out.println("The beginning index of "
    stub " is "
  • index1)
  • System.out.println("The first index value of s
    is " index2)

3
Agenda/Objectives 10-9 Cont.
  • Strings Unit8_Lecture.ppt (Slides 1-10)
  • To create and manipulate immutable character
    string objects of class String.
  • To create and manipulate objects of class
    Character.
  • In Class Assignment Work independently
  • Copy the Lesson A10 Strings folder from the
    share/Unit8 directory to your H drive
  • Read through the Lesson A10 Strings.doc
  • Complete Lab Assignment A10.1 (12)
  • Homework
  • Ch29HomeworkAssign Set1

4
Agenda/Objectives 10-10
  • Turn-In Ch29HomeworkAssign Set1
  • Keep the Lesson A10 assignments. They will be
    collected all together
  • Ch7 Arrays ArrayList Review Can you?..
  • Initialize an array of given length
  • add() elements to an ArrayList
  • set() elements in an ArrayList
  • Write a constructor that recieves parameter
    values (BankAccount a, ArrayList b, int c, double
    e, ect)
  • Gridworld how bugs work (location (r,c),
    direction, act())
  • If boolean c true and boolean d false
  • Can you calcualte !c !d and !c !d

5
Agenda/Objectives 10-10 cont.
  • When you finish the exam..
  • Ch29HomeworkAssign Set2
  • Complete all exercises from Gridworld Part 2
  • Continue working on the Lesson A10 Lab 1
  • Both will be due on Monday

6
Agenda/Objectives 10-13
  • Turn-in
  • Ch29HomeworkAssign Set2
  • Gridworld Part 2 Lesson A10 Lab 1 palindrome
  • Warm-up
  • Given the following declarations
  • int area
  • String name
  •  
  • a. area is a                                  
    variable, and name is a                           
            variable.
  •  
  • b. How many objects have been created?
                              
  •  

7
Agenda/Objectives 10-13 cont.
  • 2. Given the following section of code
  • String strA new String("Oh! ")
  • String strB new String("No! ")
  •  
  • strA strB
  • System.out.print(strA)
  • System.out.println(strB)
  •  
  • What is written to the monitor?
                                                      
                                 

8
Agenda/Objectives 10-13 cont.
  • Review Homework Ch29HomeworkAssign Set2
  • Gridworld Part 2 Lesson A10 Lab 1 palindrome
  • String Objects
  • Unit8_Lecture.ppt (Slides 12 23)
  • Also review Lesson A10.doc
  • G. Immutability of Strings
  • H. Comparing Strings
  • Ch29HomeworkAssign Set 3
  • In class A10 Lab1 part 4
  • Book Exercise 29.5 Write an application that
    uses random-number generation to create a
    sentence.
  • Use String and char arrays and associated methods
    (not StringBuffer)
  • Dont have to create the short story

9
Agenda/Objectives 10-14
  • Turn-In Ch29HomeworkAssign Set3
  • Lesson A10 Lab 1 part 4 (PigLatin), Ex29.5
  • String Objects Unit8_Lecture.ppt (Slides 24-38)
  • Locating Characters and Substrings in Strings
  • Concatenating Strings
  • Miscellaneous String Methods
  • String Method valueOf
  • Also review Lesson A10.doc
  • E. String Query Methods
  • F. String Translation Methods

Strings Quiz 10/17
10
Agenda/Objectives 10-14
  • In class A10 Lab1 part 5 - ShortHand
  • Homework Ch29HomeworkAssign Set 4
  • Assume a program declares and initializes x as
    follows
  • String x
  • x new String10
  • initialize(x) //Fills the array x with
    strings //each of length 5
  • Write the initialize method
  • Write a program which traverses the array and
    prints out the first character of all tens
    strings, followed by the second character of all
    ten strings, followed by the third character and
    so on
  • (hint use the substring method)
  • String Project A10 Lab2 Rental Car(all
    parts) - Due 10/21

Strings Quiz 10/17
11
Agenda/Objectives 10-15
  • Open Lab Day ?
  • --------------------------------------------------
    -----------------------
  • Due by the end of class Turn - In
  • A10 Lab1 part 5 ShortHand
  • Ch29HomeworkAssign Set 4
  • --------------------------------------------------
    -----------------------------------
  • Study for the
  • --------------------------------------------------
    --------------------------------------------------
    --
  • Work on..
  • String Project A10 Lab2 Rental Car(all
    parts) - Due 10/21

Strings Quiz 10/17
Write a Comment
User Comments (0)
About PowerShow.com