1. Explaining algorithms: 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
3. A possible homework assignment
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 <variable>= <expression>;
2. Write the algorithm for executing the Java if-statement
if (<boolean-expression>) <statement 1>
3. Write the algorithm for executing the Java if-else-statement
if (<boolean-expression>) <statement 1> else <statement 2>
4. Tell us in a few words what you thought of the two videos, their message, and the homework.