Compu 142 - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Compu 142

Description:

System.out.println('Manny' 6); Manny6. System.out.println('Manny' 6 7); Manny67. System.out.println('Manny' A' * 7); Manny455. Increment & Decrement. p. 75 ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 27
Provided by: shore7
Category:
Tags: compu | manny

less

Transcript and Presenter's Notes

Title: Compu 142


1
Compu 142
  • Computer Science I
  • Java
  • 2.1 2.2

2
Due Today Wed. 6/27
  • Reread 1.4-5
  • Read 2.1-2
  • Bring Windows Worksheets 2 3
  • Exercises handwritten OK

3
Whos new
  • Previous handouts

4
Questions
  • From the Questionnaires
  • Read
  • Email

5
Success
  • Be here
  • Read
  • Ponder
  • Homework
  • Study buddies

6
Flow of control (Ch. 1)
  • Trace
  • p.44 16 Strange
  • Study FooBarBazMumble p. 33
  • Expect on a quiz/test
  • Study Infinite p. 36
  • CtrlC

7
Refinement (Ch. 1)
  • Detailed structure
  • Cure redundancy
  • cone
  • V
  • box
  • Finish Rocket

8
Decomposition Example
  • p. 50 3
  • H\142\Song\ThereWasAnOldHacker.txt
  • Structure
  • Redundancy
  • Pseudocode
  • Comments Stubs

9
Chapter 2 !!
  • Data
  • Information used by the program
  • Must be stored in RAM
  • Must be stored in binary
  • How?
  • Big issue in Computer Science

10
Data in Java (2.1)
  • Primitives
  • Numbers
  • Single letters
  • True/false

11
Data in Java
  • Objects
  • Strings of letters
  • Shapes
  • People
  • Colors
  • Odors
  • ...

12
Expressions Formulas
  • Expression
  • Value
  • Set of ops that yield a value
  • Evaluation
  • Getting that value
  • Operator
  • Symbol that indicates the operation
  • Operand
  • The stuckee, the done unto

13
Literal Data
  • Typed into program
  • whole number
  • real number
  • single character
  • true, false
  • a string of characters
  • Wouldnt Excel be faster?

14
Arithmetic Operators !!!
  • Basic - /
  • Grouping ( )
  • Tracing

15
Precedence (p. 60)
  • PEMDAS
  • no E
  • unary operators ?
  • Assignment () is last

16
When you choose a data type (1)
  • You actually choose
  • How much space in RAM
  • A convenient name for that space
  • How to encode the data into binary
  • How to decode the binary
  • What operations are legal for that data

17
Mixing Types Casting
  • Java willtemporarily promote a value
  • int to double
  • char to int
  • BUT not demote a value
  • double to int
  • int to char
  • ?
  • ?

18
When you choose a data type (2)
  • You actually choose
  • How much space in RAM
  • A convenient name for that space
  • How to encode the data into binary
  • How to decode the binary
  • What operations are legal for that data

19
Variables (2.2)
  • Value can vary (change)
  • Like Excel but maybe better

20
Assignment
  • Gets the value of

21
Declaring
22
String Concatenation
  • System.out.println(Manny Moe)
  • MannyMoe
  • System.out.println(Manny 6)
  • Manny6
  • System.out.println(Manny 6 7)
  • Manny67
  • System.out.println(Manny A 7)
  • Manny455

23
Increment Decrement
  • p. 75
  • PTs ROT Separate statements

24
Variables Mixing Types
  • See slide 17

25
Hands On -- review (Ch. 1)
  • /--------------------\
  • Phineas Taylor
  • /--------------------\
  • Phineas Taylor
  • /--------------------\
  • Phineas Taylor
  • /--------------------\
  • Plan code compile run
  • Comments your name date
  • Send code to printer (use your name 142 HandsOn)

26
For Tomorrow 6/29
  • Reread 2.1-2
  • Read 2.3-4
  • Bring short programs 5 9
  • handwritten OK
Write a Comment
User Comments (0)
About PowerShow.com