Darrell Bethea May 16, 2011 1 Program 1 Due Wednesday 2 3 - - PowerPoint PPT Presentation

darrell bethea may 16 2011
SMART_READER_LITE
LIVE PREVIEW

Darrell Bethea May 16, 2011 1 Program 1 Due Wednesday 2 3 - - PowerPoint PPT Presentation

Darrell Bethea May 16, 2011 1 Program 1 Due Wednesday 2 3 Errors Strings Review 4 Syntax error - grammatical mistake in your program Run-time error - error that is detected when your program is run Logic error -


slide-1
SLIDE 1

Darrell Bethea May 16, 2011

1

slide-2
SLIDE 2

 Program 1 Due Wednesday

2

slide-3
SLIDE 3

3

slide-4
SLIDE 4

4

 Errors  Strings  Review

slide-5
SLIDE 5

 Syntax error - grammatical mistake in your

program

 Run-time error - error that is detected when

your program is run

 Logic error - the output of your program is

incorrect

slide-6
SLIDE 6

U N C i s G r e a t 1 2 3 4 5 6 7 8 9 10 11 String output = myString.substring(1, 8);

6

slide-7
SLIDE 7

 System.out.println(“How do I put \“quotes\”

in my string?”);

\” Double quote \ʼ Single quote \\ Backslash \n New line \r Carriage return \t Tab

7

slide-8
SLIDE 8

 System.out.print(“this is a string”);  System.out.println(“this is a string”);  What is the difgerence?

8

slide-9
SLIDE 9

 See p. 90

slide-10
SLIDE 10

 Meaningful names  Indenting  Documentation  Defined Constants

10

slide-11
SLIDE 11

 public static final Type Variable = Constant;  Named in ALL_CAPS  public class DefinedConstant

{ public static final double PI = 3.14159; public static void main(String[] args)

{

11

slide-12
SLIDE 12

 Hardware - physical machine

  • CPU, Memory

 Software - programs that give instructions to

the computer

  • Windows XP, Google Chrome, Games, Eclipse

12

slide-13
SLIDE 13

 Object-Oriented Programming Language

  • Classes
  • Objects
  • Methods
slide-14
SLIDE 14

 “Information hiding”  Users of a class only need to know methods  Methods in the String class

  • myString.length();
slide-15
SLIDE 15

 “many forms”  Same instruction to mean same thing in

difgerent contexts.

 In programming, this means that the same method

name can cause different actions depending on what

  • bject it is applied to.
  • rectangle.area();
  • circle.area();

15

slide-16
SLIDE 16

 Organizing classes so properties only have to

be defined once

slide-17
SLIDE 17

17

Questions?