Explaining algorithms: assignment Skip to main content JavaHyperText and Data Structures David Gries, with help from many Home Java HyperText Style Guide Eclipse 0. Create project 1. Show line numbers 2. Import preferences for automatic formatting 3. Reset layout 4. Syntax help 5. Open 2 files 6. ToDO comments 7. JUnit testing 8. Assert statement 9. Generating javadoc 10. Red square: terminating programs 11. Remove unused imports 12. Use UTF-8 character encoding API and strings 1. API documentation 3. Using Strings Explain constructs Introduction 1. Assignment statement 2. New-expression 3. Method calls 2. Try-statement Exceptions 1. Output of thrown exceptions 2. Throwable objects 3. Try-stmt/propagation 4. Throw-statement 5. Throws-clause 6. Hints Abstract classes interfaces Iterator & Iterable Program correctness Loop invariants 1. Introduction 2. Developing loops 3. Finding an invariant Stepwise refinement Recursion Intro to recursion Recursion on linked lists Recursion on trees Backtracking Hashing DFS BFS Shortest path 1. How to execute the assignment statement We hope that this little 5-minute tutorial will clear up some misconceptions and make the rest of the course easier for you and us. Developing this presentation took many many hours! It is worth it if you take fifteen minutes or so doing what we ask here. 1. Explaining how to execute the assignment statement In this 2.5-minute video, we emphasize the difference between syntax and semantics once more, show what it means to execute the assignment statement, and finally give an example of execution of an assignment. Read it here: 01presentingAlgorithmsA.pdf 2. Homework assignment HW1 The first question is easy ---you can copy from the first video or its transcript on the pdf file. Questions 2 and 3 ask about the if-statement and if-else statement. These are the same as in just about any programming language, except for the syntax, of course. So use your knowledge of these statements in whatever programming language you know. 1. Write the algorithm for executing the Java assignment statement = ; 2. Write the algorithm for executing the Java if-statement if () 3. Write the algorithm for executing the Java if-else-statement if () else 4. Tell us in a few words what you thought of the videos on presenting algorithms in English and executing the assignment statement, their message, and the homework. ©2017 David Gries