



|
|
My Intro to Object-Oriented Programming
|
Class Notes
Monday September 11 , 2000
|
|
|
CG began class with a new problem: there is a collection of congruent squares, and given the area, determine the perimeter. CG described how this problem could be solved using ``Goal-Directed Planning'', which is a procedural variant of problem decomposition (discussed in September 6 th class). CG then interacted with the class to write the Java program to solve this problem using goal-directed planning.
After discussing the perimeter problem, CG introduced some functions of the Math Class, including: Math.sqrt (< double >), Math.PI, Math.pow (< double >, < double >). The Math.pow operator can be used not only to raise a number to a power, but also to determine roots of numbers.
Some notes on arithmetic in Java:
- < int > + < int > -- > < int >
- < double > + < double > -- > < double >
- < int > + < double > -- > < double >
- Similarly for *, -, /
|
|