The midterm will be open book, open note. The reading covered by the midterm is Great Ideas, Chapters 1-4, 12 Brookshear Ch. 0, 4 Gromov, History of Internet and WWW McIver, Cyberspace as a Human Right Litman, Digital Copyright Along with the reading, the Midterm will cover the following topics from lecture: Computer Science Overview What is CS? Abstraction Analog vs. Digital The Internet HTML Tags References Ethernets and routing The Web Connecting multiple computers by passing through different networks Algorithms What is an algorithm Relationship between problems, algorithms, and programs Data structures Conditional statements Describing algorithms with Pseudocode What is memory 3 steps for using memory e.g Sequential Search, Binary Search Loops Programming in Java Java as a programming language "Java is a simple, object-oriented, distributes, interpreted, robust, secure, architecture-neutral, portablem high-performance, multi-threaded, and dynamic language." Basics Applets HTML tags for applets Compiling and executing applets Necessary Java syntax import init and actionPerformed methods Statements Syntax (ending with semicolons) Compound statements (delimited by curly braces {}) Variables and assignment Declaring variables ; int num; Primitive datatypes int, double, char, boolean Objects String, Button, TextField, DoubleField, ActionEvent Button b; b = new Button("Push Me"); Decision Trees Drawing decision trees Question: What would the first few layers of the number guessing game decision tree look like? Logical statements and operators ==, <, >, ... Numeric Computation Datatypes Operations int +,-,*,/,% double +,-,*,/ Text Manipulation Strings String constants "Hello World" Manipulating methods int length() String substring(int start, int end) indexOf(String s) Subroutines/Methods declaring methods return type (void, int, etc) and values public int doSomething() { ... } arguments public int doSomethingWithArg(int num) { if (num == 1) ... } Grammars Used to determine the validity of statements Top-down approach Start from abstract (e.g. ) and work down to actual syntax (e.g. num = num + 1;) Bottom-up approach Question: Does more than one parsing exist for a particular statement? Should the bottom up and top down approaches yield the same applications of rules (in reverse order)? Practice! Take any line of code from the first two chapters and try to parse using the rules at the end of Chapter 2 examples: m1 = new TextField(60); m1.setText("Hello World"); What happens if you try x + 4 = a * 7;