Object Oriented Programming

Object Oriented Programming - BYTHEDANIELLYNCH CHAPTERS35...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
BY THE “DANIEL LYNCH” CHAPTERS 3-5 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CHAPTER 3: Program  Statements Program Development: Software development includes four activities: 1. Establishing the requirements- the thing that a program  must accomplish 2. Creating a Design- describes how a program will meet the  requirements. 3. Implementing the Code-  implementation is the process of  writing the source code. 4. Testing the implementation- testing included running the  program many times with different inputs and carefully  studying the results. The goal of this is to find errors. An algorithm is a step-by-step process for solving a  problem. Recipes and travel directions are algorithms. Algorithms usually use pseudocode which translates  the java code into layman terms. 
Background image of page 2
Control Flow The order in which statements are executed is the flow of  control. Usually a Java applications starts with the first line of the  main method and goes down step-by-step, but by invoking  a method, one can change this flow of control.  A conditional statement also known as a selection  statement enables one to choose which statement will be  executed next. Example of this are if and if-else  statements. A boolean expression says whether something is true of  false determining which statement is  executed next. A loop, or repetition statement lets us execute the same  statement over and over again determining which  statement will be executed next.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The if-statement There are three types of loops in java: The while statement The do statement The for statement The if statement is a conditional statement  that consists of a reserved word  if  followed  by a condition, followed by a statement.  The condition must be enclosed in  parentheses and must be true or false. if ( condition ) statement ;
Background image of page 4
Equality and Rational  Operators A condition often uses one of Java's  equality operators  or  relational operators which all return boolean results: == equal to != not equal to < less than > greater than <= less than or equal to >= greater than or equal to
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
We can add an else statement to an if- clause, thus creating an if-else statement.  If the condition is true, the first assignment  statement is executed; if the condition is  false, the second statement is executed.  Only one will be executed due to the boolean  condition. if (
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Page1 / 50

Object Oriented Programming - BYTHEDANIELLYNCH CHAPTERS35...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online