Midterm Topics
The midterm will be open book, open note. However, you will only have 50
minutes to complete the test, so you should not plan to page through
your notes. The notes are just there in case you forget a term or some
syntax.
Readings covered
- Great Ideas, Chapters 1-4
- Brookshear Ch. 0, 4-5
- Emily Shops At VirtualEmporia.com
- PageRank paper
- Prelab readings
The readings serve as support for the following topics from
lecture:
- Computer Science Overview
- What is CS?
- Abstraction
- Analog vs. Digital
- The Internet
- HTML
- Networks and routing
- The Web
- Connecting multiple computers by passing through different networks
- Graphs
- Creating graphs: nodes and edges
- Directed and undirected graphs
- Network properties: degree, diameter, cyclic, connected
- Physical, biological, social, computer, and content networks
- Describing systems as graphs
- Algorithms
- What is an algorithm
- Relationship between problems, algorithms, and programs
- Data structures
- Conditional statements
- Describing algorithms with Pseudocode
- 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 +,-,*,/
- Order of precedebce
- 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
Mul>
- examples:
m1 = new TextField(60);
m1.setText("Hello World");
- What happens if you try
x + 4 = a * 7;
Jeffrey R.N. Forbes
Last modified: Fri Sep 30 15:34:43 EDT 2005