Create a simple class file that does the following: Print to a shell (dos or unix shell) the following line 10 times, increasing the multiplying power each time.
The value of PI raised to the n
Where n is the integer range of 1..10.
Compile the .java file that you created into the corresponding .class file using javac from the shell. Run the .class file using the java command.
Goals for this lesson: Get familiar with installing java and using it in its raw form. Learn basic looping control flow and simple I/O.
Suggested reading:
http://java.sun.com/javase/6/docs/api/ Math
Read the intro chapters in a java book where control flow and basic I/O are covered.
In your shell type 'java' and 'javac' and reading through what's there, trying out various options.
No comments:
Post a Comment