lecture5 - Administrative Issues Program Statements Part 1...

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

View Full Document Right Arrow Icon
Program Statements Part 1 Lecture 5 Administrative Issues • Due Tomorrow – Program 1 • No New Assignments – Program 2 and HW 1 out tomorrow • Graded Assignments –HW 0 – Program 0 Program Development • Program statements will allow creation of complicated programs • Development not only coding! • Four part development process – Establish Requirements – Create Design – Implement Code – Test Implementation Program Development • Establish Requirements – The assignment helps with this • Create Design –The objects and algorithms needed to meet the requirements Pseudocode : mix of code and English • Implement Code – The Java code implementation of the design • Test Implementation – Run the program to search for errors Program Development • Keep the process in mind during your projects! • The assignments provide rough requirements • You do the rest!
Background image of page 1

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

View Full Document Right Arrow Icon
Control Flow • Order in which statements are executed • Control flow starts at top of main() function • Method invocation changes control flow – Control jumps from main() to the method – After a method finishes, control returns to the line after the method invocation Control Flow During Method Invocation main() { myString.length(); } String.length() { } Defined in Java Standard Library Tracing Through the Flow int test1=86, test2=75; float avg; avg = (test1 + test2) / 2.0; System.out.println(“Avg is ” + avg); System.out.println(“Good job!”); Tracing Through the Flow int test1=86, test2=75; float avg; avg = (test1 + test2) / 2.0; System.out.println(“Avg is ” + avg); System.out.println(“Good job!”); test2 75 test1 86 Variables: Output: Tracing Through the Flow int test1=86, test2=75; float avg; avg = (test1 + test2) / 2.0; System.out.println(“Avg is ” + avg); System.out.println(“Good job!”); test2 75 test1 86 Variables: avg ? Output: Tracing Through the Flow int test1=86, test2=75; float avg; avg = (test1 + test2) / 2.0; System.out.println(“Avg is ” + avg); System.out.println(“Good job!”); test2 75 test1 86 Variables: avg 80.5 Output:
Background image of page 2
Tracing Through the Flow int test1=86, test2=75; float avg; avg = (test1 + test2) / 2.0; System.out.println(“Avg is ” + avg); System.out.println(“Good job!”); test2 75 test1 86 Variables: avg 80.5 Output: Avg is 80.5 Tracing Through the Flow int test1=86, test2=75; float avg; avg = (test1 + test2) / 2.0; System.out.println(“Avg is ” + avg); System.out.println(“Good job!”); test2 75 test1 86 Variables: avg 80.5 Output: Avg is 80.5 Good job! Three Ways to Control
Background image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 8

lecture5 - Administrative Issues Program Statements Part 1...

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

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