100 likes | 232 Views
Class 4: Repetition. Pretest Condition tested before block of code to repeat If condition is false initially, the block never executes Posttest Condition tested after block of code to repeat Block of code will always execute at least once Counting Repeat for a specified number of times
E N D
Class 4: Repetition • Pretest • Condition tested before block of code to repeat • If condition is false initially, the block never executes • Posttest • Condition tested after block of code to repeat • Block of code will always execute at least once • Counting • Repeat for a specified number of times • Flowchart these!
Last Class Tomorrow: Show Time! • Using the overhead, demonstrate your project: • Show your design in the form of pseudocode, flowcharts, and a verbal description of your goal. • Show your code - each method which will contain comments describing the task of each method. • Demonstrate your program by running it a few times. • Answer questions from the audience (us). • Audience will make suggestions for improving your project. • You will be required for the final exam, which will be on July 25, to describe how you improved your program. • You will also be required to implement improvements for the final demonstration on July 25.
What have we learned this week? • Polya’s Problem-Solving Methodology • Computer Programming • Control Structure • Objects • Events
What does Polya teach us? How can we use this? For what? Other classes? Real life? How does it help us to make good programs? Understand the Problem Devise a Solution Implement the Solution Evaluate the Solution Polya’s Problem-Solving Methodology
Computer Programming • Events • Control Structures • Objects
Events • Give some examples. • When do you use events in a program? • How are you using events?
The Three Control Structures:How are you using each of these in your program? • Sequence • Decision or Selection • Repetition or Loops
Objects • What does an object have? • Properties • Methods • What objects do you have? • What are some properties? • What are some methods?
What else is there to learn about computer programming? • Variables • Constants • Passing Parameters • List Data Structures • Dynamic Data Structures • Multiple Threads • Recursion • And More…
Quiz 4: Add comments to your code which match your goals and design. Email this to me:dmckinnney@usouthal.edu