Difference between revisions of "Patrick Thai"

From WLCS
Line 1: Line 1:
 
== '''Project''' ==
 
== '''Project''' ==
* [[Media:Guess.java]]
+
* [[Media:Guess.java]] Simple Guessing Game
  
 
* Create a 2D game engine that is fully functional using Java
 
* Create a 2D game engine that is fully functional using Java

Revision as of 12:51, 17 December 2009

Project

  • Create a 2D game engine that is fully functional using Java

Goals

  • Complete Variables and Expressions Section
Numbers and variables are able to be stored inside letters. a = 1
The double code can be used to store numbers such as 10.5. double a; a = 10.5;
a = (int)10.5 the result will be 10.
E is used to show scientific notation. 5 x 10⁶ = 5E6
j++; = add j to the current value and then assign the new value to j.
Strings used similar to other programming languages. String s; string s = ḧello world
the length is the length of the string. use of / for escape characters.
System.out.println is a method that takes a single argument. When that argument is a string, then the contents of the string are displayed.
Going through boolean and arrays. Assign values with arrays. Everything can go together and can be combined.
  • Complete Program Control Section
the use of if and else
different type of errors; symbols,incompatible types
it is important that at some point the loop condition should be false, so the execution of the loop body will stop. If the loop condition is always true, execution of the body will be repeated forever.
while and for
for loops that are designed specifically for situations in which the body of the loop is to be executed a number of times that is known in advance.
Variables that are declared in the loop initialization code or the loop update code of a for loop are invisible outside the for loop. If it is desired for them to be visible outside the for loop, then they must be declared prior to the loop.
  • Complete Method Section
Using the double function again.
do not find the square root of 5.76, for example, by invoking an sqrt method, use the Math.sqrt method:
Math.sqrt( 5.76 );
static, doubleme
selfish method is designed not to return a value,and the mySqrt consists of two return statements
  • Complete Object Oriented Concepts Section
Each has three variables, height, weight, and hair, and each has methods for sleeping, walking, eating, and talking.
make the three variables in which to store the data that holds the object's state (1.67, 72.6, and black)
an instance of the Person class or as a Person object (the two phrases are used interchangeably).
certain variables are hidden, and the variables are assigned certain values.
  • Simple Objects Section
keyword class. This signals to the Java compiler that we are defining a class.
talk method
when Java reads a class definition, it creates a new data type using the class name as the data type name.
class can be used to represent things such as playing cards, card array
person function, can put; hair, height, weight and do things like talk
APPoint Instances of this class will represent points on the Cartesian plane. Get distance with distance method,find distance, distance to
the length of an array cannot be changed once it is created
ArrayList<E> objects are provided with instance methods that allow us to
discover the current length of the ArrayList;
obtain the element at a particular index in an ArrayList;
replace the element at a particular index in an ArrayList by something else;
add a new element to an ArrayList;
remove a specified element from an ArrayList; and
remove all the elements from an ArrayList.

Inheritance and Polymorphism Section

Class Definitions Revisited

Abstractions Section

Algorithms (intro)

Searching and Sorting

Program Analysis

Charts

  • some important tables or charts

References