Reviewing for the test:
Question: What topics will be covered in midterm 1?
(Note: sound and music will not be covered in this test)
- Modeling and representation (concepts)
- Java programming language
- Java control flow syntax
- Elementary data types
- Packages, classes, methods, fields
- Public and private, static and final
- Class definitions and subclasses
- Representing pictures in Java
- Pixels and colors in RGB encoding
- Methods that change entire pictures (e.g. color to grayscale)
- Methods that change pictures selectively (e.g. changing shirt color)
- Methods that return new, transformed pictures (e.g. scaling)
- Simple turtle movement and manipulation in Java
- Using turtles to model coordinated behavior (e.g. dancing, chasing)
Question: Will we be expected to write code?
Answer: Yes, but you will not have to code an answer entirely from scratch. Either we will give you code templates for you to complete, extend or correct, or we will give you examples that you may find useful in constructing your answers.
Question: Will we be penalized for incorrect Java syntax?
Answer: Yes, but not in an all-or-nothing way. By the end of the course, you will be expected to have mastered Java syntax, and you will have had a lot more practice. At this stage of the course, I am more interested in your understanding of the concepts.
- If you are a Python programmer, don't forget Java's semicolons and braces. Indentation is good practice and will make your answer more readable, but the real indicator of program structure is these two punctuation symbols. Don't forget them!
- If you are a Matlab programmer, don't forget to use methods and dot notation rather than the function notation that you used before. (This applies to Python people as well to a lesser extent.) So, remember to say student.passTest(midterm) not passTest(student, midterm).
- Carefully review for loops. It's not just the syntax: the combination of initialization, continuation condition and iteration condition in the head of the loop make the Java for loop trickier than the analogous loop in either Python or Matlab, but much more powerful.
- Make sure you understand the use of the keyword new and the definition of constructors. Look at the class definitions in the media library (such as Turtle, Picture, etc.)
- Try to remember the methods that you use, but don't sweat this. In practical programming, unlike a close book test, you get to inspect the documentation. (Just consider how many different overloaded method names there are in JMusic – a package you won't need anyway for this test. No one learns them all.) If you get a name wrong, it's not a big deal at this stage.
Link to this Page